读书人

_javascript的,该怎么处理

发布时间: 2012-03-07 09:13:51 作者: rapoo

________-----javascript的
方法1:
<script language= "javascript ">
function xxx()
{
//var txt1=document.getElementById( "txtAttachment ");
alert( "xx ");
//txt1.value= "xxx ";
//lbox.options[lbox.selectedIndex].value=document.getElementById( "file1 ").FileName;
}
</script>

<input name= "btnAddAttachment " type= "button " id= "btnAddAttachment " onclick= "xxx() " value= "添加 " />

方法2:

<input name= "btnAddAttachment " type= "button " id= "btnAddAttachment " onclick= "alert( 'xx ') " value= "添加 " />

为什么方法1不可以,2就可以,1错在哪?

谢谢!


[解决办法]
我试过可以啊
[解决办法]
说说怎么不可以了?

[解决办法]
<input name= "test " type= "button " id= "test " onclick= "test " value= " " />
改为

<input name= "test " type= "button " id= "test " onclick= "test() " value= " " />

[解决办法]
可以运行啊
[解决办法]
你加"()"这个的时候IE没报错吗?

应该是你的输入法的问题吧.

-------------------------

一定要加 "() "?

这个我个人认为应该得加(没去找过依据),而且必须得加
[解决办法]
()要加的,要注意全角和半角

读书人网 >JavaScript

热点推荐