nagunpyo
asked on
Any difference between onmouseover='src="img1.gif"' and onmouseover='this.src="img1.gif"'
I just realized that when I assign a function to an event, I've been randomly using either,
onmouseover='src="img1.gif "'
or
onmouseover='this.src="img 1.gif"'
and either of them work just fine
Are there any differences in those two?
I see more people are using this.src=..., are there any problems with just doing src=...
onmouseover='src="img1.gif
or
onmouseover='this.src="img
and either of them work just fine
Are there any differences in those two?
I see more people are using this.src=..., are there any problems with just doing src=...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, you are right. I was to sure so I did not test before.
Now I see it:
<script>
var src = 42;
</script>
<img src="test2.gif" onmouseover='alert(src);sr c="smily.j pg"' >
The alert does show the image src and not the global var.
We can reopen this question and refund the points because you found the answer: the assignment methods are equivalent.
Now I see it:
<script>
var src = 42;
</script>
<img src="test2.gif" onmouseover='alert(src);sr
The alert does show the image src and not the global var.
We can reopen this question and refund the points because you found the answer: the assignment methods are equivalent.
ASKER