Here's a look at this example:
The code is as follows |
Copy Code |
<input type= "hidden" name= "attr_value_list[" "Rel=" "4" all= "4" "Value=" "> <input type= "hidden" name= "attr_value_list[" "Rel=" "4" all= "4" "Value=" "> <input type= "hidden" name= "attr_value_list[" "Rel=" "4" all= "4" "Value=" "> <input type= "hidden" name= "attr_value_list[" "Rel=" "4" all= "4" "Value=" ">
|
Now, what if you want to delete one of the input?
The original method:
The code is as follows |
Copy Code |
function Delrow (WHO) { $ ("Input:hidden[name= ' attr_value_list[]"). Remove (); }
|
So all the objects are deleted. Obviously, it won't work.
Right way:
The code is as follows |
Copy Code |
function Delrow (WHO) { $ ("Input:hidden[name= ' attr_value_list[] ']:last"). Remove (); } |
This is the last one to delete the object. What if you want to delete more than one?
Such
The code is as follows |
Copy Code |
for (i=0;i<num;i++) { $ (' input:hidden[all= "' +id+ '"]:last '). Remove (); } |
Num Here is the number of deletes
This will enable you to delete multiple objects pull!