Search code examples
javascripthyperlinknoscript

Make div (with behaviour like button created with JS) into link if javascript is disabled


I have 6 div's that have onclick javascript. When you click them a part of the site changes.

I want these divs to contain links if javascript is disabled. (instead of changing the part of the page link to another page)

How would I do that?


Solution

  • <div>
       <a href="noscript.htm" onclick="window.location='script.htm';return false;">button</a>
    </div>
    

    something like this?​ http://jsfiddle.net/C6BJT/