vendredi 1 avril 2022

It is possible to get all checkbox value into comma seperated string in jquery

<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
  <label for="vehicle1"> I have a bike</label><br>
  <input type="checkbox" id="vehicle2" name="vehicle2" value="Car">
  <label for="vehicle2"> I have a car</label><br>
  <input type="checkbox" id="vehicle3" name="vehicle3" value="Boat">
  <label for="vehicle3"> I have a boat</label><br><br>

i want all checkbox value like below there is any possible

$(document).ready(function () {
var ckhvalue="'bike','car','boat'";
});



Aucun commentaire:

Enregistrer un commentaire