I have a page that has a whole bunch of buttons
<button value=<?php val?> class='hot' >Hot</button>
and Im selecting them by class because the values will all be different. Im trying to have them, on click, alert the value, but I can't figure out how to access the value field.
My function is
$(".hot").click(function() {
});
and I tried to access it(after much time spent googling) using:
$(this).find('option:selected').attr('value');
resulting in
$(".hot").click(function() {
$(this).find('option:selected').attr('value');
});
however, when I alert that, it just says undefined.
And ideas would be awesome! Im pretty familiar with php, but javascript and JQuery are pretty new to me, so links and good explanations are really appreciated, not just an answer. Thanks!