[Meteor JS] – You can use classes or ids

You can use classes or ids to take values or apply some functions. Look:

To take value from IDs: ( How to take a value by ID attribute in HTML ? )

$('#myID').val();

To take value from classes: ( How to take a value by Class attribute in HTML ? )

$('.myClass').val();

Examples :

html code :
<input id="date" type="text" class="form-control" />

js code:
$('#date').val();
html code :
<input id="date" class="myDate" type="text"  />

js code:
$('.myDate').val();

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s