3. HTML Documents
HTML Headings
HTML headings are defined with
the <h1> to <h6> tags:
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
4. HTML Documents
HTML Paragraph
HTML paragraphs are defined with the <p> tag:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
5. HTML Documents
HTML Links
HTML links are defined with the <a> tag:
<a href="http://www.w3schools.com">This is a
link</a>
6. HTML Documents
HTML Images
<img src="w3schools.jpg" alt="W3Schools.com"
width="104" height="142">
7. HTML Documents
HTML Classes
Classing HTML elements, makes it possible to define CSS styles
for classes of elements. Equal styles for equal classes, or
different styles for different classes.
<div class="cities">
<h2>London</h2>
<p>
London is the capital city of England. It is the most populous city
in the United Kingdom, with a metropolitan area of over 13
million inhabitants.
</p>
</div>
8. HTML Documents
HTML meta name 常用屬性
<meta name="description" content="網頁簡短描述"> 用來寫網
頁的簡短描述。
<meta name="keywords" content="網頁關鍵字"> 用來放置
網頁關鍵字。
<meta name="author" content="作者姓名"> 記錄網頁的作者名稱
<meta name="generator" content="編輯器名稱"> 用來記錄網頁
編輯器名稱
<meta name="copyright" content="網頁版權"> 用來標示網頁的版權或
著作權聲明
<meta name="distribution" content="網頁發佈地區"> 用來記錄網
頁的發佈地區
HTML 5 新增的 meta 功能
<meta charset="UTF-8">
設定網頁編碼,UTF-8 是萬國碼
9. HTML Forms
The <input> Element
The <input> element is the most important form
element.
The <input> element has many variations,
depending on the type attribute.
Type Description
text Defines normal text input
radio Defines radio button input (for selecting one of
many choices)
submit Defines a submit button (for submitting the
form)
14. JavaScript
JavaScript is the programming language of HTML
and the Web. Programming makes computers do
what you want them to do.
15. JavaScript
Local JavaScript Variables
function myFunction() {
var carName = "Volvo";
// code here can use carName
}
16. JavaScript
Global JavaScript Variables
var carName = " Volvo";
// code here can use carName
function myFunction() {
// code here can use carName
}
18. JavaScript
The Lifetime of JavaScript Variables
The lifetime of a JavaScript variable starts when it
is declared.
Local variables are deleted when the function is
completed.
Global variables are deleted when you close the
page.
20. JavaScript
JavaScript Objects
var person = {firstName:"John", lastName:"Doe", age:50,
eyeColor:"blue"};
var person = {
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
};
person.lastName;
person["lastName"];
21. JavaScript
JavaScript Events
HTML events are “things” that happen to HTML
elements. When JavaScript is used in HTML
pages, JavaScript can "react" on these events.
25. Jquery
jQuery is a JavaScript Library.
jQuery greatly simplifies JavaScript programming.
jQuery is a lightweight, "write less, do more",
JavaScript library.
26. Jquery
The jQuery library contains the following features:
HTML/DOM manipulation
CSS manipulation
HTML event methods
Effects and animations
AJAX
Utilities
27. Jquery
jQuery Syntax
$(selector).action()
A $ sign to define/access jQuery
A (selector) to "query (or find)" HTML elements
A jQuery action() to be performed on the
element(s)