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

Explain jquery.noconflict? : jquery mobile

0 Answers  


Difference between parent() and parents() in jQuery?

0 Answers  


Explain .bind() vs .live() vs .delegate() vs .on()

2 Answers  


Tell me how to write browser specific code using jquery? : jquery mobile

0 Answers  


Define data paremeter of jquery ajax method?

0 Answers  






What is jquery.size()? : jquery mobile

0 Answers  


Explain the difference between jquery-x.x.x.js and jquery.x.x.x min.js?

0 Answers  


Why we use chaining in jquery?

0 Answers  


What are the paremeter of jquery ajax method?

0 Answers  


Explain remove class jquery with example?

0 Answers  


What is a cdn? : jQuery Mobile

0 Answers  


What is jquery.noconflict? Explain

0 Answers  


Categories