07-24-2023, 07:45 AM
Both `div`s have the same class but I want to make the lower `div` be hidden and after clicking on first `div`'s button the second `div` becomes visible
techniques:
* on click add css property
* or remove hidden property
* or any other option if possible
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
function myfunction() {
document.getElementById('bb').style.cssText = 'visibility:visible';
}
<!-- language: lang-css -->
.ab {
width: 200px;
height: 200px;
background: black;
}
#bb {
visibility: hidden;
}
<!-- language: lang-html -->
<script src="test.js"></script>
<div class="ab">
<input type="Email" placeholder="Email" /><br/>
<input type="password" placeholder="password" /><br/>
<button type="submit" value="submit" id="btn">Submit</button></div>
<div class="ab" id="bb" onclick="myfunction()">
<p>
<font color="white">you have succesfully registered</font>
</p>
<button type="submit">Return</button>
</div>
<!-- end snippet -->
techniques:
* on click add css property
* or remove hidden property
* or any other option if possible
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
function myfunction() {
document.getElementById('bb').style.cssText = 'visibility:visible';
}
<!-- language: lang-css -->
.ab {
width: 200px;
height: 200px;
background: black;
}
#bb {
visibility: hidden;
}
<!-- language: lang-html -->
<script src="test.js"></script>
<div class="ab">
<input type="Email" placeholder="Email" /><br/>
<input type="password" placeholder="password" /><br/>
<button type="submit" value="submit" id="btn">Submit</button></div>
<div class="ab" id="bb" onclick="myfunction()">
<p>
<font color="white">you have succesfully registered</font>
</p>
<button type="submit">Return</button>
</div>
<!-- end snippet -->