I have php code which executes a loop, inside which it generates the following:
echo "<input type=\"button\" event='$eventID' id=\"sendsomeone\" value=\"Send a family member\"/>";
echo "<span id='$eventID'></span>";
Later, I have javascript which follows:
$('input:button').click(function() {
$(this).next("span").append('You clicked this button!');
}
This code works fine. But I want it to also hide the button (but not all the buttons on the page)
I’ve tried fooling with code like
$(this).parent("input").hide();
and $(this).prev("input").hide();
But I can’t puzzle out how to make it work.
It looks like you’re already in the buttons selector by using
$('input:button'), so have you tried doing this?