How to get data-target value using data-room in jquery -
how data-target value using data-room in jquery. example:
<div data-target="10" data-room="test@gmail.com"></div>
note: test@gmail.com dynamic value.
thanks,
construct attribute selector, email address inserted search term.
var target = $('[data-room="' + email + '"]').data('target');
an attribute selector looks this, adding search text dynamically:
$('[data-room="searchtext"]');
note: double quotes important search text contains special characters. otherwise might treated part of selector , cause break.
Comments
Post a Comment