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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -