JS lesson 2: CSS pseudo class

We can use CSS pseudo class to select items we need.

<option selected>1</option>
select option:selected === select > optgroup > option:selected

select option:myproperty  // this is wrong

Javascrint and Jquery way of finding elements
select option:first-child === $(select).find(option).first();
select option:last-child === $(select).find(option).first();

Leave a Reply

Your email address will not be published. Required fields are marked *