So I just started with HTML and JavaScript and I thought it would be fun to experiment with iFrames.
But I ran into a problem I can't seem to solve: Uncaught TypeError: Cannot read property 'value' of null
This is the code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
var link = document.getElementById("LinkJ");
var button = document.getElementById("ButtonJ");
var surf = document.getElementById("SurfJ");
function PressButton(){
surf.src = link.value;
}
</script>
</head>
<body>
URL:
<input name="LinkN" id="LinkJ" type="url" value="http://www.bing.com/"></input>
<button name="ButtonN" id="ButtonJ" onclick="PressButton()">Surf</button>
<br><br>
<iframe name="SurfN" id="SurfJ" style="position: absolute; height: 80%; width: 90%" src="http://www.bing.com/">
</iframe>
</body>
</html>