2013年11月11日 星期一
LAB 26
<!DOCTYPE html>
<html>
<body>
<div style="opacity:0.5;position:absolute;left:300px;width:890px;height:200px;background-color:#40B3DF"></div>
<div style="font-family:verdana;padding:20px;border-radius:10px;border:20px solid #EE878A;">
<div style="opacity:0.3;position:absolute;left:120px;width:100px;height:200px;background-color:02FA22"></div>
<h3>HTC IPHON SAMSUNG </h3>
<div style="letter-spacing:12px;">2581</div>
<div style="color:#40B3DF;">KOBE
<span style="background-color:#B4009E;color:#ffffff;">BRYAN</span>
</div>
<div style="color:#000000;">NBA..</div>
</div>
</body>
</html>
<html>
<body>
<div style="opacity:0.5;position:absolute;left:300px;width:890px;height:200px;background-color:#40B3DF"></div>
<div style="font-family:verdana;padding:20px;border-radius:10px;border:20px solid #EE878A;">
<div style="opacity:0.3;position:absolute;left:120px;width:100px;height:200px;background-color:02FA22"></div>
<h3>HTC IPHON SAMSUNG </h3>
<div style="letter-spacing:12px;">2581</div>
<div style="color:#40B3DF;">KOBE
<span style="background-color:#B4009E;color:#ffffff;">BRYAN</span>
</div>
<div style="color:#000000;">NBA..</div>
</div>
</body>
</html>
2013年11月10日 星期日
2013年11月4日 星期一
LAB 22
<html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="f" method="get" id="exampleForm" onsubmit="return check()">
search:<input type="text" id="examplePass" name="q" >
<input type="submit" value="submit">
<br>
</form>
</body>
<script>
function check(){
var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/;
if(!passwordRegex.test(f.q.value)){
alert("!!!!!!");
f.q.value="";
return false;
}
}
/*
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
return false;
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="https://maps.google.com/" name="f" method="get" id="exampleForm" onsubmit="return check()">
search:<input type="text" id="examplePass" name="q" >
<input type="submit" value="submit">
<br>
</form>
</body>
<script>
function check(){
var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/;
if(!passwordRegex.test(f.q.value)){
alert("!!!!!!");
f.q.value="";
return false;
}
}
/*
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
return false;
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年11月3日 星期日
HOMEWORK 10-28-2013
訂閱:
文章 (Atom)