I have the hidden field:
<input type="hidden" class="deleted" name="Deleted" data-id="2" value="@Model.Deleted" />
so there is going to be a few of these on the page but with different data-id values.
I’m wanting to get this particular one and set the value to true.
To get all hidden fields would be?
$(':hidden')
However I only want to get ones with class="deleted" so this would be?
$(':hidden.deleted')
Now I want to narrow it down to the one with data-id="2"
How to do this?
Try the following: