-2
I have the following code below
<body>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr class='item'>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
<input type="hidden" value="0">
</tr>
<tr class='item'>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
<input type="hidden" value="1">
</tr>
</table>
</body>
<Script>
$(document).on('click', '.item', function(){
console.log(this);
$(this).remove();
});
</script>
I want to take the value of the invisible input or even some particular column. The click event I made I can get all the element TR and child elements, however I can not access a data in specific by This. Someone can help me, if I can get the value of the input that comes in This?
I can also filter by which other ne tag?
– Jhony
of course. You just need to change the tag and the input selector. If you want you can even choose more than one tag by separating by comma within the tag, for example 'input, div'. I recommend you research more about selectors in jquery
– Felipe K. Bernardino