Best Online Resource For Non-Resident Indians      SEARCH COOLNRI.COM
 HOME  FORUMS  PORTALS & REVIEWS  RECIPES  INDIAN RESTAURANTS  GROCERY  CLASSIFIEDS  NEWS  CONTACT  LOGIN
Welcome Guest Search | Active Topics | Members | Log In | Register

How do you select an item using css class or ID and get the value by use of jquery? Options
ramkumar65
Posted: Monday, May 23, 2011 10:59:41 PM
Rank: Member
Groups: Member

Joined: 7/8/2008
Posts: 1
If an element of html like < div> , < p> or any tag have ID MyId and class used MyClass then we select the element by below jquery code

$('#MyId') for ID and for classs $('.MyClass') and for value

var myValue = $('#MyId').val(); // get the value in var Myvalue by id
Or for set the value in selected item

$('#MyId').val("print me"); // set the value of a form input
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

COOLNRI.COM 2006-2012 |  TERMS OF USE |  PRIVACY STATEMENT |  SEARCH