1

I am successfully using html buttons for a NAV bar on the upper part of the html page and they work great there (transfer to the URL).

example syntax from upper page:

<button class="nav" type="button"
onclick="javascript:location.href='services_page.html'">
Services</button>

Problem: Then I am using more html buttons for an EXIT bar on bottom part of html page where they look great but do not activate (no transfer to URL).

example syntax from lower page:

<button class="bar" type="button" 
onclick="javascript:location.href='http://www.amazon.com/'">
Amazon.com</button>

The lower buttons do work when re-positioned near top of page? Tried, but just cannot get lower page buttons to work near bottom?

JSON C11
  • 11,272
  • 7
  • 78
  • 65
kennr
  • 49
  • 1
  • 1
  • 6
  • use `window.open` it will open amazon site in new window – Mahi Nov 20 '16 at 16:17
  • 1
    Make sure there isn't some element over the bottom part of the page that can't be seen. Use inspector or give background color to all elements. Using a high z-index might clarify, as well. – rfornal Nov 20 '16 at 16:33
  • Hello, even window.open not working for me. something more must wrong on my html page, unknown? used following: all buttons clearly visible. – kennr Nov 20 '16 at 16:34
  • Hello, I checked further as you said. Yes indeed it was a (transparent background) overlay problem. Some caption text using a transparent background (and not completely formatted yet) must have been overlaying the lower buttons and knocked out their functions. Could not see it because transparent overlay. So I moved those lower text and image items down further which let the lower buttons come back on. Then reformatted lower image and caption text, all done. Thank you so much. – kennr Nov 20 '16 at 18:10
  • Possible duplicate of [onclick="location.href='link.html'" does not load page in Safari](http://stackoverflow.com/questions/6418634/onclick-location-href-link-html-does-not-load-page-in-safari) – Sᴀᴍ Onᴇᴌᴀ Dec 16 '16 at 17:14

1 Answers1

1

Dont use javascript:.

just use location.href='http://www.amazon.com/'

Please check this, it works fine

<button class="bar" type="button" 
onclick="location.href='http://www.stackoverflow.com/'">
stackoverflow.com</button>
jafarbtech
  • 6,842
  • 1
  • 36
  • 55