首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

初学javascript 基础有关问题

2012-02-06 
初学javascript 基础问题!DOCTYPEhtmlPUBLIC-//W3C//DTDXHTML1.0Transitional//EN http://www.w3.org/

初学javascript 基础问题
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<script   language= "javascript1.3 ">

function   method()
{
alert( "失去焦点 ");
}
</script>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>

</head>

<body>
<form   id= "form1 "   name= "form1 "   method= "post "   action= " ">
    <p   align= "center ">
        <input   name= "textfield "   type= "text "     onBlur= "method() "   value= "这里请输入你的名字 "   />
    </p>
</form>

</body>
</html>


为什么失去焦点的事件不会发生呢?   反而提示有错误   谢谢!

[解决办法]
method是关键字
[解决办法]
method()
起个有意思的名字不错,但你着过分了~
[解决办法]
function method()
改成其他名字 比如function method1()
关键字你也敢用 真是的

[解决办法]
或者改成 onblur= "window.method() "

热点排行