php echo head echo script function showHide id if document getElementB

1
2
3
4
5
6
7
8
<?php
echo "<head>";
echo "<script>function showHide(id) if(document.getElementById(id).style.display != '') document.getElementById(id).style.display = '';";
echo "else document.getElementById(id).style.display = 'none';}</script>";
echo "</head>";
echo "<table onClick=(showHide(tt))><tr><td>asdasdasd</td></tr></table>";
echo "<table style='display: none;' id=tt><tr><td>WORK</td></tr></table>";
?>