<html>
<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])*$/;
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
2013年10月27日 星期日
2013年10月21日 星期一
Lab 15 Hand code a form
<html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="q" method="get" id="exampleform">
search:<input type="text" name="q" id="examplePass">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="q" method="get" id="exampleform">
search:<input type="text" name="q" id="examplePass">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>
Lab 14 Lab Form and Action
1.<html>
<head> </head> <body> <form action="http://google.com.tw/search" name="q" method="get"> <input type="text" name="q" /> <input type="submit" /> </form> </body>
<head> </head> <body> <form action="http://google.com.tw/search" name="q" method="get"> <input type="text" name="q" /> <input type="submit" /> </form> </body>
2.
<html>
<body>
<form action="http://google.com/search" name="q" method="post">
Search:<input type="text" name="q" >
<input type="submit" value="submit">
<br>
</form>
</body>
</html>
Lab 13 change pictures
<html>
<body>
<img onmouseover="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8wEwn576gAEDDBXouMkDT-x5CvsiW6xsZoPXtyHVOXjpl4OoYfDog6zZUttnR1gS7SbnIoAl6B9BZ42P7-WJqhnsY2vAvQj9Fjg3Hslzo1bMWoMUA2BpIyz6Fi-Pa9QdTS_zyjwTktg/s320/DSC_1795.JPG'" onmouseout="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2a3V41koHoHcAUB91-D5qCHlWTiiHDZR9MSq_0Nk0OfxyBOK58s3QaGr55fYZLi93R7_rVZg9RZsP3swjlBXlvX2mukyaVkZynS6yuETLA0pMesWkSeDFw5WYvybk6Sk7ZQIvH-ut9PQu/s320/DSC_1772.JPG'" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8wEwn576gAEDDBXouMkDT-x5CvsiW6xsZoPXtyHVOXjpl4OoYfDog6zZUttnR1gS7SbnIoAl6B9BZ42P7-WJqhnsY2vAvQj9Fjg3Hslzo1bMWoMUA2BpIyz6Fi-Pa9QdTS_zyjwTktg/s320/DSC_1795.JPG"</img>
</script>
</body>
</html>
<body>
<img onmouseover="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8wEwn576gAEDDBXouMkDT-x5CvsiW6xsZoPXtyHVOXjpl4OoYfDog6zZUttnR1gS7SbnIoAl6B9BZ42P7-WJqhnsY2vAvQj9Fjg3Hslzo1bMWoMUA2BpIyz6Fi-Pa9QdTS_zyjwTktg/s320/DSC_1795.JPG'" onmouseout="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2a3V41koHoHcAUB91-D5qCHlWTiiHDZR9MSq_0Nk0OfxyBOK58s3QaGr55fYZLi93R7_rVZg9RZsP3swjlBXlvX2mukyaVkZynS6yuETLA0pMesWkSeDFw5WYvybk6Sk7ZQIvH-ut9PQu/s320/DSC_1772.JPG'" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8wEwn576gAEDDBXouMkDT-x5CvsiW6xsZoPXtyHVOXjpl4OoYfDog6zZUttnR1gS7SbnIoAl6B9BZ42P7-WJqhnsY2vAvQj9Fjg3Hslzo1bMWoMUA2BpIyz6Fi-Pa9QdTS_zyjwTktg/s320/DSC_1795.JPG"</img>
</script>
</body>
</html>
2013年10月13日 星期日
訂閱:
文章 (Atom)





