I have a HTML element:
<a style='text-decoration:none;' id='$innerdata[0]' class='cat' href='#'> <input type='checkbox' name='vehicle' value='Bike'> $innerdata[1]</a>
I am trying to get the value of checkbox.
$('body').on('click', '.cat', function()
{
$topcat = $(this);
alert ($topcat.closest().find('[type=checkbox]').val());
}
But alert is printing undefined.
How to get the value of checkbox ??
Aucun commentaire:
Enregistrer un commentaire