What is the correct syntax of jQuery?

What is the correct syntax of jQuery?
A. action().$(selector)
B. $(selector).action()
C. (selector)$.action()
D. action().(selector)$
 
Answer: b
Explanation: The basic syntax of jQuery is $(selector).action(), $ sign defines access of jQuery, (selector) is HTML element, action() is for the jQuery action that is to be performed. E.g. $(“h1”).hide(), this will hide all the <h1> elements.
 

Tìm kiếm

Back
Top