shake demo

Click to shake the box.

Wednesday, 20 November 2013

Open Link in New Tab

HTML
<!DOCTYPE html>
<html>
<body>
<a href="http://www.google.com" target="_blank">Visit google.com!</a>
<p>If you set the target attribute = "_blank", the link will open in a new tab.</p>
</body>
</html>



JavaScript
<!DOCTYPE html>
<html>
<body>Click the button to open a new tab.</br>
<script>
function newTabFunction()
{
window.open("http://www.google.com");
}
</script>
<button onclick="newTabFunction()">Click Me</button>
</body>
</html>

No comments:

Post a Comment