Hey there! I have a simple fix for those who know JavaScript. I have some code that changes the height style on the first click, but I'm looking for a way to revert back to the original height style on the second click.
Here's the code snippet:
<!DOCTYPE html>
<html>
<body>
<button type="button" id="myBtn" onclick="myFunction()">test</button>
<script>
function myFunction() {<!-- w w w .ja v a 2s .c om-->
document.getElementById("myBtn").style.height = "50px";
}
</script>
</body>
</html>
While this code works fine on the first click, I need it to return to the original height on the second click. Can anyone offer some assistance?