I have a webpage - http://www.example.com/ - where I have a button. On click of the button I need to go to a particular link (www.google.com). The button is like :
<input type="button"
onclick="javascript:location.href='www.google.com'"
value="Click" />
But this button opens a page "http://www.example.com/www.google.com" which is wrong URL.
I have tried window.location
, document.location
, document.location.href
, location.href
but all in vain.
The URL in my onclick can not be restricted to begin with 'http://'.