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

自个儿动手-表单2

2012-11-01 
自己动手-表单2!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/

自己动手-表单2

<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript">window.onload=function(){var btnTest=document.getElementById("btnTest");btnTest.onclick=function(e){var username=document.getElementById("username");if(username.value=="macrotea"){var loginForm=document.getElementById("loginForm");loginForm.submit();}else{//方式1:/*if(e){e.preventDefault();//标准方式}else{event.returnValue=false;//IE方式}*///方式2:return false;}}}</script><style type="text/csss"></style></head><body>    <form id="loginForm" name="loginForm" method="post" action="http://macrotea.iteye.com">        <p>用户名: <br />            <input name="username" type="text" id="username" value="macrotea1" />            <br />            <input type="button" name="btnTest" id="btnTest" value="测试"/>        </p>    </form></body></html> 

?

热点排行