Is there a way of assigning a value to a variable 'onclick' (of a button), but without having to use a separate script (<script> ... </script>) in the page?
Also, can you use a variable to define the data path for, say, a flash object?
Code:
<object width="400" height="400" data=" <!-- here --> "></object>
I had failed to find the answer to either of my questions by searching the internet, and although the answer to the first one was probably staring me in the face the whole time, your help was much appreciated.
With a bit of figuring I got the other to work as well - but only after I realised it had to go within a function, in a <script> tag (I am new to Javascript )
Ah yes, I think I see how it works now. For some reason I had in my head that you could only call functions or assign values to variables on a button click.
Ah yes, I think I see how it works now. For some reason I had in my head that you could only call functions or assign values to variables on a button click.
Ummm...yes. I think that's true. I mean you could just execute and expression to no purpose (e.g., onclick="3*4") but that's pretty pointless.
So yes, my code assigns to one variable and invokes one function, so how is it different than what you thought you could do?
__________________
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.