Javascript:
http://www.w3school.com.cn/js/js_intro.asp
html file
<!DOCTYPE html>
<html>
<body>
.
.
<p>
this my test.
</p>
<button id="submit" οnclick="alert(popUpDialog2(5, '10'))">Submit</button>
<form action="submitpage.htm" οnsubmit="return validate_form(this)" method="post">
Email:
<input type=" text" name="email" size="30" />
<input type ="submit" value ="提交"/>
</form>
.
.
<script type="text/javascript" src="C:\Users\v-bojia\Desktop\Js\function.js">
</script>
</body>
</html>
Js file
function popUpDialog() {
var person = new Object();
person.firstname = "Bill";
var strArrary = new Array("Talk", "Test", "Add");
var a = 2;
var b = 3;
var c = a + b;
for (var i = 0; i < 3; i++) {
document.write(person.firstname);
}
}
function popUpDialog2(p1, p2)
{
try
{
aaaaa(p1, p2);
}
catch(err)
{
alert(err.message);
return p1 + p2;
}
}
function validate_required(field, alerttxt) {
if (field.value == null || field.value == "")
{ alert(alerttxt); return false }
else { return true }
}
function validate_form(thisform) {
if (validate_required(thisform.email, "Email must be filled out!") == false)
{ thisform.email.focus(); return false }
}
Html:
http://www.w3school.com.cn/html/html_intro.asp
html file:
<html>
<head>
<link rel="stylesheet" type="text/css" href="C:\Users\v-bojia\Desktop\Js\htmlLearn.css">
<!-- <style type="text/css">
h1 {
color: red;
}
p {
color: blue;
}
</style>-->
</head>
<body bgcolor="yellow">
<h1 align="center">head1</h1>
<hr />
<p>phase2</p>
<br />
<a href="http://www.facebook.com" target="_blank">facebook</a>
<img src="WP_20130714_003.jpg" width="100" height="80" />
<hr />
<table>
<tr>
<td>aaa</td>
<td>bbb</td>
</tr>
<tr>
<td>ccc</td>
<td>ddd</td>
</tr>
</table>
<abbr title="Louis is a good student">Louis...</abbr>
<br />
<acronym title="Louis si a bad student">Louis...</acronym>
<br />
<bdo dir="rtl">Here is some Hebrew text</bdo>
<p>
当使用命名锚(named anchors)时,我们可以创建直接跳至该命名锚
(比如页面中某个小节)的链接,这样<a id="user">使用者</a>就无需不停地滚动页面来寻找他们需要的信息了。
</p>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a href="#user">点这里跳转到使用者</a>
<div>
div2
</div>
</body>
</html>
css file:
h1
{
color: red;
}
p
{
color: blue;
}