How do I get certain values of a HTML attribute in Javascript? -



How do I get certain values of a HTML attribute in Javascript? -

i take value of attribute, process , replace php variable value receive @ end.

the info attribute data-id, need assistance getting value of data-id javascript on click event, rest can do.

an example:

person clicks tag data-id set as, say, 7. i'd need extract 7 html code , javascript variable can work said value.

i hope clear enough

try this

$('#someelement').click(function(){ $(this).data('id'); });

javascript html

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -