日期:2014-05-18  浏览次数:20392 次

________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错在哪?

谢谢!

------解决方案--------------------
方法一正常执行