你的位置:首页 > 软件开发 > 网页设计 > 获取form对象

获取form对象

发布时间:2016-11-28 12:00:55
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&qu ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html ="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <style type="text/css"></style> <script type="text/javascript"> window.onload=function(){    //获取name=form1的元素对象    var theForm = document.form1;    //给form对象添加属性    theForm.method ="post";    theForm.action ="login.php";    //theForm.entype="application/x-www-form-urlencoded";    //输出当前的编码方式    //window.alert(theForm.enctype);     } </script> </head> <body> <form name="form1"> 用户名:<input type="text" name="username" /> 密码:<input type="password" name="userpwd" /> <input type="submit" value="提交表单" /></form> </body></html>

原标题:获取form对象

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录