24 lines
493 B
HTML
24 lines
493 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Document</title>
|
|
</head>
|
|
<body>
|
|
<input type="text" id="field" />
|
|
<button id="myBtn">Go</button>
|
|
|
|
<script type="text/javascript">
|
|
document.getElementById("myBtn").addEventListener("click", function(){
|
|
var url = document.getElementById("field").value;
|
|
|
|
window.location.href = url;
|
|
|
|
// OR
|
|
|
|
window.open(url);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|