View Full Version : Acceptable practise

Mr J
02-09-2004, 08:04 PM
Is it acceptable to put a value in an IMG tag to be referenced by a function

<img onclick="myclick(this.id,'mydiv')" src="pic.gif" id="mypic" value="52">

02-09-2004, 08:15 PM
Just make sure you customize the DTD to keep the code valid.
However since you use the explicit onclick call why not make it part of the function arguments:
<img onclick="myclick(this.id,'mydiv',52)" src="pic.gif" id="mypic">

Mr J
02-09-2004, 08:18 PM

Never thought of that