I have a page with some values that looks like this:
<div id="productList" >
<input type="hidden" name="product[0].id" value="21">
<div id="21" >BeanCounter</div>
<input type="hidden" name="product[1].id" value="22">
<div id="22" >CallGate</div>
</div>
Now I want to delete the hidden field with value=21
and the div with id=21
.
I have this:
function remove(id){
var remove = $(id);
$('productList').removeChild(remove);
But how do I delete the hidden field? Can you get an object by its value?
edit missed the mootools tag, not sure where the jquery tag came from. I guess mootools isn't that common but hopefully this could be done with plain javascript.
Hmm tag got changed back to jquery again?