|
So, please.. if anyone could help?
I basically want a function that alerts a variable, and I can keep re-defining that variable whenever i implement the function...(optimisticly the variable can be a strong of text).
So like this
<script type="text/javascript">
function myfunc(variable)
{
alert(variable);
}
</script>
Then whenever I want to use the function in my body i can do something like this:
<input type='button' onClick='myfunc(somethinghere)'>
<input type='button' onClick-'myfunc(differentstuffhere)'>
And preferebly it should be able to read everything in the parentheses as a string, if possible. but its not working, even with a simple variable, please help.
note, i also tried the following for the function, and it still didn't work:
function myfunc(variable)
{
var something = variable;
alert(something);
}
|