Home > Back-end >  Why jquery get Input vaLue vaLue has been the first Id (a great god give directions)
Why jquery get Input vaLue vaLue has been the first Id (a great god give directions)

Time:04-13

Element position is no problem,

Jquery code:

$(" # dataList. Text - center "). Click (function () {

Var id=$(" # dataList input [type="hidden"] "). The val ();
Alert (id);
If (confirm (" sure to delete?" )) {
Window. The location="${pageContext. Request. ContextPath}/role/del? Id="+ id;
}
});


The JSP code:




Id="selall" type="checkbox" & gt;












The ${varstatus. Count} & lt;/td>
${role. RoleName} & lt;/td>
${role. RoleDesc} & lt;/td>










Choose delete, the parameter Id is always 1.,,,,,,,, choose any one to delete, Id is 1


CodePudding user response:

Id is a unique identifier, repeated problems will emerge

CodePudding user response:

This code is blind to write simple and correct term a lot, I just wrote a most simple and suitable for JSP
 


Seriously, only master to the point you don't use binding, traps pit
  • Related