Hey there! any question in your mind? Ask It Now!.

Popular Categories

onClick a button redirect to a URL in JAVASCRIPT

+5 votes
asked in Programming by payel (1,660 points)
Hello i want a button in which onClick a button by user redirect to a URL in JAVASCRIPT.

Thanks For answer.

2 Answers

+1 vote
answered by Kaperly (1,610 points)
selected by payel
Best answer

hey you can use this script 

function newUrl()
Html part button
<input type="button" value="visit url" onclick="newUrl()">
By this onClick a button by you can redirect to a URL.
+1 vote
answered by amit_pammu Expert (5,030 points)
<!DOCTYPE html>
function newDoc()
  window.location.assign("http://www.google.com")//your url here

<input type="button" value="Go" onclick="newDoc()">


Related Questions

Not a Member yet?

Ask to Folks Login

My Account
328 Folks are online
0 members and 328 guest online
Your feedback is highly appreciated