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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -