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

What is the difference between the knockout and jquery?

0 Answers  


How to stop jqm from auto-enhancing an element? : jquery mobile

0 Answers  


How you get server response from an ajax request using jquery?

0 Answers  


How do you select an item using css class or id and get the value by use of jquery.

0 Answers  


What is the difference between parent() and parents() methods in jQuery?

1 Answers  






How do you stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements?

1 Answers  


what are the features of jquery

0 Answers  


How can related code be encapsulated? Give example.

0 Answers  


What are the various ajax functions available in jquery ?

0 Answers  


What are the the two types of cdns?

0 Answers  


Can there be more than one ready function in jquery?

0 Answers  


explain width() vs css(‘width’) in jquery

0 Answers  


Categories