Let's say I have two php files.
index.php
<?php
include ('navigation.php');
?>
and navigation.php
<div class="nav">
<li>
<a id="nav1" href="">Navigation1</a>
</li>
<li>
<a id="nav2" href="">Navigation2</a>
</li>
</div>
Navigation2 should be for admins only, so it should be hidden. In this example with javascript.
index.php
<body onload="admin();"
<?php
include ('navigation.php')
?>
</body>
<script>
function admin(){
document.getElementById('nav2').style.display = "none";
</script>
Why isn't this working and how do I make it work?