html - Javascript - extract span value -
hi there wondering how span value="example" object using javascript.
playlist = document.getelementbyid("list"); playlist.addeventlistener("click",playnext,false); function playnext(){ var next = playlist.value; alert(next); }
as html
<span id="list" value="neededvalue">object1</span>
i unable extract "neededvalue" span object, have had success returning innerhtml span.
thanks,
you want use data attribute store value. here article on , how use them http://html5doctor.com/html5-custom-data-attributes/
Comments
Post a Comment