Hello guys, I have a very simple problem for you to solve. It's not simple for me but it's probably very easy to you guys. I've tried searching this but failed.
Anyway, here is my problem. I have an image. When I call a function with onclick, I pass the image's id. My problem is that when I click the image, it displays "undefined". It is supposed to display the value of the image. It works perfectly fine in internet explorer. Its firefox that's giving me the problem. Can you guys give me the code for firefox so I can adjust? Please tell me why it won't work also. kthx
html code:
<img src="Lighthouse.jpg" class="card" id="card1" value="50" onclick="reveal('card1')">
javascript code
function reveal(id)
{
card=document.getElementById(id);
alert(card.value);
}