There are situations where we want to find element based on data- attributes. For instance we have to set validation message at run time for a given field.
In these situations we can use jQuery to easily find an element based on the data- atttibutes as shown below.
$('span[data-valmsg-for="' + fieldName + '"]');
cheers,
Samitha
In these situations we can use jQuery to easily find an element based on the data- atttibutes as shown below.
$('span[data-valmsg-for="' + fieldName + '"]');
cheers,
Samitha
No comments:
Post a Comment