I am trying to use a jQuery to hide something and show a form in a table, but right now I hide or show everything on my custom tag. How could I make this script only target an ID that I could give to those tag?
$(document).ready(function() {
$(".hide").click(function() {
$("p").hide(100);
$("z").show(100);
});
$(".show").click(function() {
$("p").show(100);
$("z").hide(100);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<table class="table table-bordered">
<th>début vacance</th>
<th>fin vacance</th>
<th>supprimer vacances</th>
<tr th:each="vacations : ${selectedUser.getVacations()}">
<td th:utext="${vacations.getStartVacation()} ">...</td>
<td th:utext="${vacations.getEndVacation()} + ${vacations.id}">...</td>
<td>
<p th:text="${vacation.fistname}">...</p>
<z th:text="${vacations.id}">...</z>
<button class="hide">Hide</button>
<button class="show">Show</button>
</td>
</table>
button in that row, not all the table, i was maybe thinking i could give them an id, but i don't know how to put that in the script