Preface:
I have never finished learning a JS book since I got started with JavaScript. From today on, I will learn, organize, and share the js Code in my learning process.
The code that will be released in the future does not mean that it is completely original. On the contrary, many parts will be originated from the Internet, and of course there will be no less worry-free scripts. I hope you will not try it after reading it.
Reprimand on the Forum. After all, "Indecent "! It is published here to share it with friends who used to be the same as me or who are learning the front line. At the same time, I
I also hope that more people will be supported here. If you have any suggestions or comments, please follow up more. Join us! Thanks!
Instance 1,
This example describes the simple applications of navigator, cookie, screen, location object, function call, prompt, alert, and confirm interaction.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> click me </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Example 2,
This example describes the simple application of event objects and events.
<Html> <pead> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> <title> mouse </title> </pead> <body onMouseMove =" GetPosition (); "> press the mouse in the text box: <input type = "text" name = "textfield" onMouseDown = "alert ('Press the mouse in the textbox ')"> press the keyboard: <input type = "text" name = "textfield" onKeyDown = "alert ('Press the keyboard ');"> event object: <input type = "text" name = "textfield" id = "text" onClick = "catchEvent (); "> <input type =" submit "name =" Submit "value =" submit "id =" button "onClick =" catchEvent (); "> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Instance 3,
This example describes how to use arrays and Their slice () methods.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta name = "Generator "CONTENT =" EditPlus "> <meta name =" Author "CONTENT =" "> <meta name =" Keywords "CONTENT =" "> <meta name =" Description "CONTENT = ""> </HEAD> <BODY> array and its slice () use method </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Example 4,
This example describes how to use objects and constructor methods.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta name = "Generator "CONTENT =" EditPlus "> <meta name =" Author "CONTENT =" "> <meta name =" Keywords "CONTENT =" "> <meta name =" Description "CONTENT = ""> </HEAD> <body> Use of constructor </body> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Instance 5 (4.1 ),
This example describes how to use a Document Object.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Instance 6 (4.2 ),
This example describes how to use a Document Object to read form elements.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Instance 7 (4.3 ),
This example describes how to use a Document Object to read form elements, a registration verification code.
<Html> <pead> <title> User Registration </title> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> <style type =" text/css "> </style> </pead> <body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]