newboy
04-04-2003, 07:57 PM
Hi friends
I wrote this code by attachEvent
-----------------------------------------------
<input type="Button" name="bt1" value="test">
<script>
function func1()
{
alert("nonargument")
}
bt1.attachEvent("onclick",func1)
</script>
----------------------------------------------
Its work well ,but I want give to func1() an argument:
-----------------------------------------------
<input type="Button" name="bt1" value="test">
<script>
function func1(number)
{
alert(number)
}
bt1.attachEvent("onclick",func1(15))
</script>
----------------------------------------------
But this will eventuate an error!
Why?
I wrote this code by attachEvent
-----------------------------------------------
<input type="Button" name="bt1" value="test">
<script>
function func1()
{
alert("nonargument")
}
bt1.attachEvent("onclick",func1)
</script>
----------------------------------------------
Its work well ,but I want give to func1() an argument:
-----------------------------------------------
<input type="Button" name="bt1" value="test">
<script>
function func1(number)
{
alert(number)
}
bt1.attachEvent("onclick",func1(15))
</script>
----------------------------------------------
But this will eventuate an error!
Why?