I have the HideCheckbox() function to be executed inside a php loop.
the main point is to hide the checkbox every time the div loads.
However, the checkbox will be hidden only in the first div.
Here is the code:
<script type="text/javascript">
function HideCheckbox() {
document.getElementById("deleteCarCheckbox").style.display = "none";
}
</script>
<?php
$username = $_SESSION['username'];
try{
$link = mysqli_connect("localhost","root","","db");
$sql = mysqli_query($link,"a sql query");
while ($donnees = mysqli_fetch_array($sql)){
?>
<div class="block-car">
<input type="checkbox" id="deleteCarCheckbox" name="deleteCar" style="float:right">
</div>
<script type="text/javascript">
HideCheckbox();
</script>
<?php
}
catch(Exception $e){die('Erreur : '.$e->getMessage());}
}
?>