var checkboxes = document.getElementsByName('vechicle'); for (var checkbox of checkboxes) {. To get the values of selected checkboxes in array. The prop() method provides a way to get property values for jQuery 1.6 versions, while the attr() method retrieves the values of attributes. For example – var cbValue = $('#cb')[0].checked; console.log($('#cb')[0].checked); Listen To Checkbox Change This method manipulates the ‘checked’ property and sets it to true or false depending on whether we want to check or uncheck it. You need to send the checkboxes value in the form of an Array when the form gets submitted then you can loop over $_POST values. for(var i=0; i