PDA

View Full Version : Help with Javascript...



Anza Power
02-21-2009, 13:12:04
Hello, I don't know if this is the appropriate place to post this, if not I apologize and ask that this thread be moved/merged...

Anyways I've made that riddle gae called The Calculator, and I've used simple Javascript to make it cool and unique, but one skill I haven't managed to get to work, is making some buttons change something in another object on the page...

Just out of randomness I tried putting in, let's say I wanna change the value of a button on the screen when you push a picture, so I put in onClick="B1.value='Something new'" (with B1 being the name for that button) and it worked, but then I found out that it's uneffective in Firefox, only in IE, can anyone tell me why?

Here's an example of what I'm talking about:

http://www.freewebs.com/anzapower/Buttonsample.htm

Can you test it with all browsers you have and tell me which ones work and which don't?

Damar
02-25-2009, 01:55:26
it worked in ie and opera but not firefox

on looking it i changed a small part and got it working in all 3.. this is the part i changed for the b1 button was not defined in firefox for how it interpret javascript

<p align="center"><input type="button" value="AA" id="B1"></input></p>
<p align="center"><input type="button" value="Click Me" onClick="B1.value='BB'" id="B2"></input></p>

hope that helps you a bit

Anza Power
02-28-2009, 10:35:12
^ Oh wow thanx alot dude, now it works...:D