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



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

Answer / Nitish Kumar Gupta

You can use jQuery's $.*(selector) to select an item based on its CSS class or ID, and then use $.val() to get the value. For example: $('.myClass').val() or $('#myID').val().

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

What is the difference between event.PreventDefault and event.stopPropagation?

1 Answers  


Is jquery html() method works for both html and xml documents?

1 Answers  


How to set jquery mobile responsive table width to 100% width despite css styles? : jquery mobile

1 Answers  


Explain the script build up by jquery?

1 Answers  


Can there be more than one ready function in jquery?

1 Answers  


Tell me an example usage of jquery mobile? : jquery mobile

1 Answers  


Why is only the first page of multi page document loaded? : jquery mobile

1 Answers  


How to use connect in jquery?

1 Answers  


Jumping off of jquery ui for a second, do you 'release early, release often' with all of your projects? What are your thoughts on that strategy?

1 Answers  


Is jquery is json library file or a javascript?

1 Answers  


Which command will give a version of jQuery?

1 Answers  


Why we use chaining in jquery?

1 Answers  


Categories