I have been working on this issue with innerhtml. I am having the innerhtml submit onclick and transform into a link when a condition is met by the function. BUT it takes 1 click to activate the link from the innerhtml and ANOTHER click to actaully use the link. The function used is here for the onlick: function genoutput() { var s1 = document.getElementById('display1').value; var s2 = document.getElementById('display2').value; if(s1 == 1 && s2 == 5){ document.getElementById('submit').innerHTML = '<a href="economical.html"><img src="images/submit.jpg" alt="submit" /></a>'; } else{ alert(s2); } } Is it possible to get this down so the user need only click once? Thanks
If you know the URL you can use the following one-liner to load it as the last step in the function: document.location='http://www.whatever.com';
I think the method JeffHood mentioned is best, if the one click is just going to redirect to a certain URL why waste time 'showing' the active link when you can just do document.location="URL" to the destination.