Forum Moderators: open
Have a slideshow navigation and want to put a DOM onubtrusive JS that finds
the <a> in <li id="nav-back">and executes history.back() with a onclick handler. No worry about JS disabled because then I use a other link that is hidden when JS is enabled ...
Some questions-ideas
What do i need to put in the <a href="?"> of <li id="nav-back">?
And the script I started see below, should it be written like that?
History.back() works perfectly cross-browser in DOM capable browsers?
This is the HTML
Code:
<div id="navwrap">
<ul id="nav">
<li id="nav-prev"><a href="#" title="go to previous image">previous</a></li>
<li id="nav-back"><a href="#" title="go to overview of images">back to overview</a></li>
<li id="nav-forward"><a href="#" title="go to next image">next</a></li>
</ul>
</div>
Is this how to do go about it with the script
Code:
if (!document.getElementbyId) {return;} var backButton = document.getElementbyId('nav-back').document.getElementBytagname('a') backButton.onclick = history.back(); }