Hey,
So i have this challenge with my code. I want it to store the cursor values after mouse event is triggered.
Here is my JS code trying to have two sets of cursor values stored;
<script>
function RHS(){
var e = window.event;
var posX1 = e.clientX;
var posY1 = e.clientY;
var posX2 = e.clientX;
var posY2 = e.clientY;
var A;
var B;
var RHS;
A = posX1 * posY1; //A(x,y)
B = posX2 * posY2; //B(x,y)
if (B >= A){
RHS = B/A;
}
else {
RHS = A/B;
}
alert(RHS);
}
</script>
Note: My code works but its not how I want. I Imagined clicking in the window twice would have different values for the different clientX; and clientY; sets as i clicked again.