I'm working on some website. I have a question. How to give class name to JS function. Here is my code:
<div class="grid-item">
<div id="info">
<div class="glyphicon glyphicon-search" style="hidden: hidden;">
</div>
<img onmouseover="show(this)" onmouseout="hide(this)" src="'smiley.gif'" />
</div>
</div>
My JS function look like this
function show(x) {
x.style.hidden= visible;
}
function hide(x) {
x.style.hidden= hidden;
}
But in onmouseover and onmouseout i do not want to use this. I what to show or hide
<div class="glyphicon glyphicon-search" style="hidden: hidden;"></div>
from html. How to do this? My idea is to give to this div id and then that id to pass to function, but how to do this.
Remeber that i will have a lot of div tags (), for every picture.
And also how to position that div on right top corner of image?
Thanks.