I have a code where I need to put a variable inside a javascript that is the ID of the person I'm pulling, but I can not find the solution. Where am I going wrong?
<?php echo "
<tr>
<td>".$row['nome']."</td>
<td>".$row['telefone']."</td>
<td>".$idade."</td>
<td>".$row['cidade']."</td>
<td>".$row['cargo_pretendido']."</td>
<td><button onclick='mostrar()' class='w3-button w3-black'>INFOk123</button><td>
</tr>
<div id='id\"$row['id']\"' class='w3-modal'>
<div class='w3-modal-content'>
<header class='w3-container w3-teal'>
<span onclick='sumir()' class='w3-button w3-display-topright'>×</span>
</header>
<p>Teste</p>
</div>
</div>
";
}
echo "<br>";
}
?>
<script language="javascript" type="text/javascript">
function mostrar() {
document.getElementById('id"<?php echo $row['id']; ?>"').style.display='block';
}
function sumir() {
document.getElementById('id"<?php echo $row['id']; ?>"').style.display='none';
}
</script>