Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $menu1="Home";
- $menu2="About";
- $menu3="Careers";
- $menu4="Gallery";
- $menu5="Contact";
- ?>
- <html>
- <head>
- <script type="text/javascript">
- var myarray=["<?php echo $menu1;?>","<?php echo $menu2;?>","<?php echo $menu3;?>","<?php echo $menu4;?>","<?php echo $menu5;?>"];
- //Run when DOM is ready
- window.onload=function(){
- for(var i=0; i<myarray.length; i++){
- var link= document.createElement('a');
- link.href="#";
- link.innerHTML=myarray[i];
- document.body.appendChild(link);
- document.body.appendChild(document.createElement('br'));
- }
- }
- </script>
- </head>
- <body>
- </body>
- </html>
Add Comment
Please, Sign In to add comment