Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Random number in img tag
03-21-2012, 05:12 PM #1
- Join Date
- Nov 2007
- Thanked 0 Times in 0 Posts
Random number in img tag
I need to write something like this: http://justsheri.com/webscripting/wsassignment/1049950/
If you look at the code there is 52 of these <img src = './images/blank1.png'
onClick='clickCard("qh",0)'/> where clickcard("numchanges", increments by 1) how is this done?
03-21-2012, 08:56 PM #2
Well, I wouldn't do it the way that was done.
All you really need is
<img src="blank.png" id="c1" onclick="card(this);"/>
With "c1" through "c52".
Then you keep the array of card name/images in JS instead of putting the card name into the layout. Makes it easier to code.
But after that... Is this homework? I see that the page you referred us to is, so it makes me think you are doing homewerk as well.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.