Learning HTML, and I have this code. At the beginning <div id = "inp">
is hidden ( due to class
, CSS file )
I want to hide the <div id="prods">
when I click the button in the <form>
section and show the the <div id = "inp">
function disp(prod, inp) {
var x = document.getElementById(prod);
var y = document.getElementById(inp);
x.style.display = "none";
y.style.display = "block";
}
.hidden {
display: none;
}
<div id="prods">
<form>
<button type="button" onclick="disp(prods,inp)">
Next page</button>
</form>
</div>
<div id="inp" class="hidden">
<form>
</form>
</div>
But when I click the button nothing really happens