I have a project to make 2 buttons that containing value before and after test score.
The student is 50 and every student have 2 buttons that containing their previous and present test score in some subject. the button is placed in 2 columns Before and After, sorted by highest score and resize them depending on their score. So we don't know how to identify which was the pair of those buttons.
So I decide to make if that "id" of pairing button is same eg: id="Score1" and id="Score1_a"
Progress now, I make the pairing button in "Before" and "After" Columns change their color to Red if we hover mouse on one of them.
But it's still not enough.. So I use script to make the buttons bigger when we hover on it, but I don't know how to Revert it back to original size. Can you guys help me?
This is my script:
<script>
function mouseover(obj) {
var id2=obj.id+"_a";
document.getElementById(obj.id).style.background = "magenta";
document.getElementById(obj.id).style.width = "100px";
document.getElementById(obj.id).style.height = "100px";
document.getElementById(id2).style.background = "magenta";
}
function mouseout(obj) {
var id2=obj.id+"_a";
document.getElementById(obj.id).style.background = "deepskyblue";
document.getElementById(id2).style.background = "deepskyblue";
document.getElementById(obj.id).style.offsetwidth;
document.getElementById(obj.id).style.offsetheight;
}
</script>
<button id="score1" style='width:70px; height:70px;'>70</button>
<button id="score1_a" style='width:65px; height:65px;'>65</button>
<button id="score2" style='width:25px; height:25px;'>25</button>
<button id="score2_a" style='width:50px; height:50px;'>50</button>
Thanks.