How do i make this function open up www.google.com after the button is created o
ID: 3936632 • Letter: H
Question
How do i make this function open up www.google.com after the button is created on a new page? In other words, When i click on the button google, it should open up www.google.com. Here is my html code:
<tr>
<td> Google</td>
<td> Google Search</td>
<td> <button>Lets find something</button></td>
</tr>
and javascript code:
function googleSearch(){
page += "<button>google</button>";
}
Explanation / Answer
Hi,
I have modified the code and it is reddirectint to the google page when you click on button.
<html>
<head>
<title>
Google
</title>
<script type="text/javascript">
function googleSearch(){
var page = "http://www.google.com";
window.location(page);
}
</script>
</head>
<body>
<table>
<tr>
<td> Google</td>
<td> Google Search</td>
<td> <button>Lets find something</button></td>
</tr>
</table>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.