s10026164
最新留言
Loading...
最新留言
Loading...
2014年6月16日 星期一
2014年6月9日 星期一
lab12
<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="text" id="examplePass" />
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit =function() {
var passwordRegex = /^[+-]?\d+[.]?\d*[,][+-]?\d+[.]?\d*$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
var notify = document.getElementById("notify");
if (notify === null){
notify = document.createElement("p");
notify.textContent = " ERROR ";
notify.id = "notify";
var body = document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="text" id="examplePass" />
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit =function() {
var passwordRegex = /^[+-]?\d+[.]?\d*[,][+-]?\d+[.]?\d*$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
var notify = document.getElementById("notify");
if (notify === null){
notify = document.createElement("p");
notify.textContent = " ERROR ";
notify.id = "notify";
var body = document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>
lab19
<html>
<body>
<form name="find" action="http://google.com/search" method="get">
find:<input type="text" name="q" value=""><br>
<input type="submit" value="search">
</body>
</html>
<body>
<form name="find" action="http://google.com/search" method="get">
find:<input type="text" name="q" value=""><br>
<input type="submit" value="search">
</body>
</html>
訂閱:
文章 (Atom)