Start the Remove program $ ("#deleteDetail"). Click (function () {///Get the ID set of the option already selected if (Confirm ("OK" to delete the chosen record? ==true) {//Get the selected record Idvar idset= ""; The string variable $ ("[name= ' did ']:checked") used to record the check box selected value. Each (function () { //) Gets the item selected by the user based on the Name property and the checked state. It is important to note that earlier versions of jquery were not written in this way idset+=$ (this). Val () + ","; Gets the value of the selected check box and adds to the preceding string variable, notice that there is a comma,}) idset=idset.substr (0,idset.length-1);//delete the last comma if (idset== "")//If the string variable is also empty, Indicates that the user did not select the value {alert ("no record selected. ");} Else{$.ajax ({ //In Ajax method, the user selected value is passed to the background type: "Get", Data:{id:idset},datatype: "html", url: "phpcode/ Deletedetails.php ", Success:function (data) {alert (data),}});}})
jquery How to get user-selected values