How can I get my code to work using an If/Else statement, instead of on click like I currently have? While also displaying it in the IFrame?
My Current Code
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1> Final Project</h1>
<p> Click Radio Button to Display 1 of 3 Maps!</p>
</head>
<div class="iframe_container">
<form>
<input type="radio" name="iframe" value="type" onClick= "go('https://storymaps.arcgis.com/stories/e7219a51b6a4411aace9ea68fb9c9cf2')"/>Story Map<br>
<input type="radio" name="iframe" value="type" onClick = "go('https://acgis.maps.arcgis.com/apps/webappviewer/index.html?id=4a1566b7f7fb49ae8c9c470a6f371a78')"/> Web APP <br>
<input type="radio" name="iframe" value="type" onClick = "go('API_File.html')"/> Web APP API
</form>
</div>
<body>
<script>
function go(loc){
console.log(loc);
document.getElementById('iframe').src = loc;
}
</script>
<div class="logins_details_container">
<iframe id="iframe" src="https://storymaps.arcgis.com/stories/e7219a51b6a4411aace9ea68fb9c9cf2" width="100%" height="60%"></iframe>
</div>
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire