How do you select element by ID in jQuery?



How do you select element by ID in jQuery?..

Answer / chaitanya

To select element use ID selector. We need to prefix the id with "#" (hash symbol). For example, to select element with ID "txtName", then syntax would be,

Hide Copy Code

$('#txtName')

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Does jquery 2.0 supports ie? : jquery mobile

0 Answers  


Can you please explain the difference between .js and .min.js? : jquery mobile

0 Answers  


How do you get the attribute of an html tag in jquery?

0 Answers  


Write a basic jquery code?

0 Answers  


How to check jQuery version?

0 Answers  






What are the selectors in jquery? How many types of selectors in jquery?

0 Answers  


Explain the use of the .pushstack() method.

0 Answers  


Explain finish method in jquery? : jquery mobile

0 Answers  


What is jQuery?

1 Answers  


Explain some features of jquery knockout?

0 Answers  


Is vanilla js faster than jquery?

0 Answers  


How can we debug jQuery?

0 Answers  


Categories