My current task involves increasing the bottom-padding of a span when the mouse hovers over a button. Here is the button code:
<button class="btn btn-success btn-circle" id="myBtn" title="Go to top">
<span id="move" class="fa fa-chevron-up"></span></button>
To accomplish this, I attempted to create a class with increased bottom-padding (13px) using JavaScript.
Here is the class I created:
.set {
padding-bottom:13px;
}
And here is the JavaScript code I used:
window.onload = function() {
document.getElementById("myBtn").onmouseover = function() {
document.getElementById("myBtn").classList.add(" set");
}
}
Unfortunately, this approach did not yield the desired results. Can anyone provide assistance? The objective is to revert the span's bottom-padding back to its default value of 3px when the mouse is no longer on the button. Thank you!