Location href Property - Set the href value to point to another web site: - Javascript Browser Object Model

Javascript examples for Browser Object Model:Location

Description

Location href Property - Set the href value to point to another web site:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Send mail</button>

<script>
function myFunction() {//from w  w w.ja  v a2 s  . com
    location.href = "http://google.com";
}
</script>

</body>
</html>

Related Tutorials