第十五次作业
Posted 037吴宜珊
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第十五次作业相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> 函数</title> <script> function displayDate() { document.getElementById("demo").innerHTML=Date(); } </script> <script src="24.js"></script> </head> <body> <p id="demo">ppp</p> <script> document.write(Date()); document.getElementById("demo").innerHTML=Date(); </script> <buttom type="button" onclick=window.alert("number")>press</buttom> </body> </html>
function myFunction(){ document.getElementByld("demo").innerHTML="javascript函数"; }
2.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> 函数</title> <script> function displayDate() { document.getElementById("demo").innerHTML=Date(); } </script> <script src="24.js"></script> </head> <body> <p id="demo">ppp</p> <script> document.write(Date()); document.getElementById("demo").innerHTML=Date(); </script> <buttom type="button" onclick=window.alert("number")>press</buttom> </body> </html>
3.—6
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登录</title> <script> function fnlogin() { var oUname=document.getElementById("uname") var oError=document.getElementById("error_box") if (oUname.value.length<6){ oError.innerHTML="用户名至少6位" } if(oUname.value.length>6&opassward.value.length<6){ oError.innerHTML="密码至少为6位" } } </script> </head> <body> <div class="box" > <h2>登录</h2> <div class="input_box"> <input id="uname" type="text" placeholder="请输入用户名"> </div> <div class="input_box"> <input id="upass" type="password" placeholder="请输入密码"> </div> <div id="error_box"><br></div> <div class="input_box"> <button onclick="fnlogin()">登录</button> </div> </div> </body>
以上是关于第十五次作业的主要内容,如果未能解决你的问题,请参考以下文章