羅東好帥>//////<
2013年11月11日 星期一
Lab 26 Design your business card
<html>
<body>
<div style="background-color: black; height: 500px; left: 600px; opacity: 0.5; position: absolute; width: 100px;">
</div>
<div style="border-radius: 50px; border: 50px solid #EE872A; font-family: verdana; padding: 10px;">
<div style="background-color: #8ac007; height: 60px; left: 60px; opacity: 0.3; position: absolute; width: 500px;">
</div>
<h3>
HO-YAN LIN</h3>
<div style="letter-spacing: 5px;">
Chung Yuan Christian University</div>
<div style="color: #40b3df;">
Electronic Engineering
<span style="background-color: #bbbbbe; color: black;">CYCU<span>
</span></span></div>
<div style="color: black;">
10026313</div>
</div>
</body>
</html>
<body>
<div style="background-color: black; height: 500px; left: 600px; opacity: 0.5; position: absolute; width: 100px;">
</div>
<div style="border-radius: 50px; border: 50px solid #EE872A; font-family: verdana; padding: 10px;">
<div style="background-color: #8ac007; height: 60px; left: 60px; opacity: 0.3; position: absolute; width: 500px;">
</div>
<h3>
HO-YAN LIN</h3>
<div style="letter-spacing: 5px;">
Chung Yuan Christian University</div>
<div style="color: #40b3df;">
Electronic Engineering
<span style="background-color: #bbbbbe; color: black;">CYCU<span>
</span></span></div>
<div style="color: black;">
10026313</div>
</div>
</body>
</html>
Homework 11-5-2013
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
var re = /\(?\d{3}\)?([-\/\.])\d{3}\1\d{4}/;
function check(){
var OK = re.exec(f.q.value);
if (!OK)
{window.alert(RegExp.input + " isn't a phone number with area code!");
f.q.value="";
document.f.q.focus();
return false; }
else
window.alert("Thanks, your phone number is " + OK[0]);
}
</script>
</head>
<body>
<p>Enter your phone number (with area code) and then click "Check".
<br>The expected format is like ###-###-####.</p>
<form name="f" action="#" onsubmit="return check()" method="get">
check:<input type="text" name="q">
<input id="phone" type="submit" value="check">
</form>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
var re = /\(?\d{3}\)?([-\/\.])\d{3}\1\d{4}/;
function check(){
var OK = re.exec(f.q.value);
if (!OK)
{window.alert(RegExp.input + " isn't a phone number with area code!");
f.q.value="";
document.f.q.focus();
return false; }
else
window.alert("Thanks, your phone number is " + OK[0]);
}
</script>
</head>
<body>
<p>Enter your phone number (with area code) and then click "Check".
<br>The expected format is like ###-###-####.</p>
<form name="f" action="#" onsubmit="return check()" method="get">
check:<input type="text" name="q">
<input id="phone" type="submit" value="check">
</form>
</body>
</html>
2013年11月4日 星期一
LAB22
<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>
訂閱:
文章 (Atom)