hello i have some problem with jquery val()
when i click on div , jquery don’t show value just white page, what is incorrect ?
html
<div class='item' value='first test'>test</div>
jquery
$(".item").click(function() {
var item_id = $(this).val();
document.write(item_id);
});
i know i can use id but i have more than 1 div’s
i dont know maybe div don’t support value ?
please help me with this problem or write some similar solution.
divdoesn’t supportvalue, trydata-attributes.