Welcome to the Treehouse Community
Looking to learn something new?
carine todmia6,071 Points
i thought $(".selected") was considered improper syntax for jquery
Pavle Lucic10,801 Points
carine todmia hi,
Maybe you get confused by this code
The first part $(".selected") - it is Jquery selector (almost same as you would select elements in CSS). It selects html element with class selected and create jquery object from him.
Another part is .removeClass("selected") - it is Jquery method (there is not dot at the end). So every object can have methods. This method removeClass, removes class selected from $(".selected") html element.
$("") syntax is the most common way of selecting the elements in the DOM with jQuery. You can use it to select an element using HTML tag names the way you do in CSS:
You can also use it select an element by its class or id:
$(".selected").hide() // or $("#form-submit").hide().