How do you select element by ID in jQuery?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between event.PreventDefault and event.stopPropagation?

517


How do you update ajax response with id " resilts"?

533


What is jquery toggle function?

510


What is a jquery ?

468


JQuery or JavaScript which is quicker in execution?

495






How to load a page using jquery mobile? : jquery mobile

466


Is window.onload is different from document.ready()?

421


How do you install/use jquery in a project. What is the minimum setup needed to start using jquery.

462


What is jquery selectors? Give some examples.

469


How we can get the input value of an element using jquery?

450


What is the use of val() method in jquery?

515


Explain the difference between javascript and jquery? : jquery mobile

447


What are selectors in jquery?

464


Mention some advantages of jquery.

519


Define type paremeter of jquery ajax method?

440