/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
This goes in your HTML where you want the menu, or other file, to appear: <script language="JavaScript" type="text/javascript" src="js/menu.js"></script> Create a new file called "menu.js" document.write('<ul class="menu">'); // START LINKS // <!-- Copy and paste to add more links. Note the first link starts the list, so don't copy that. --> document.write('<li>'); document.write('<a href="index.html" class="menu">Home</a>'); document.write('</li><li>'); document.write('<a href="about.html" class="menu">About Us</a>'); document.write('</li><li>'); document.write('<a href="services.html" class="menu">Services</a>'); document.write('</li><li>'); document.write('<a href="gallery.html" class="menu">Photo Gallery</a>'); document.write('</li><li>'); document.write('<a href="testimonials.html" class="menu">Testimonials</a>'); document.write('</li><li>'); document.write('<a href="contact.html" class="menu">Contact Us</a>'); document.write('</li>'); // END LINKS // document.write('</ul>');