I’m using JavaScript to get the element’s id on mouse over. But I am not getting it.
As per my code it is showing null.
My code is:
function getid() {
var e = document.getElementById(this);
alert(e);
}
and I am calling the function on:
<input
style="margin: 8px 4px 4px 4px; width:142px; height:117px;"
type="image"
id="img"
src="images2.jpg"
onmouseover="getid();"
onmouseout="outmouse();"
/>
How can I get the elements id on mouse over?
check this