I have a code that shows a hidden div when a "?a='enter div number'"code was entered on the last part of the url.
<html>
<title> </title>
<head>
</head>
<body>
<div id="tab1" style="display:none" >
<p> "This is div 1" </p>
</div>
<div id="tab2" style="display:none">
<p> "This is div 2" </p>
</div>
<div id="tab3" style="display:none">
<p> "This is div 3" </p>
</div>
</body>
<script type="text/javascript">
if (window.location == 'http://localhost/assignment.html'){
document.getElementById("tab1").style.display="block";
}
if (window.location == 'http://localhost/assignment.html?a=2'){
document.getElementById("tab2").style.display="block";
}
if (window.location == 'http://localhost/assignment.html?a=3'){
document.getElementById("tab3").style.display="block";
}else{
document.getElementById("tab1").style.display="block";
}
</script>
</html>
somehow when I enter http://localhost/assignment.html?a=2 the result gives a "this is div1" and "this is div2"