JS (JavaScript) is a kind of explanatory language
is weak / dynamic
The first to use for form validation
Five parts of JS:
1. Core language Definitions
2. native objects and built-in objects
5boolean
3.BOM
4.DOM
5. Event-Handling model
Data type
1.Undefined
2.Number
3.Object
4.String
When the function has no explicit return value, the value returned is undefined
the single and double quotes in JS are not very different, they are all strings.
BOM: Browser Object model
The top level window
The size of the page can be obtained by DOM to operate
SetTimeout ()// execute only once
SetInterval ()//Dead loop
Document.images// get a collection of all pictures
window.location//Address bar
Window.history//historical record
Window.history.go (-1)//return to upper level
Window.navigator//Get the version of the operating system
Dom
Document
API a set of functions / Properties
Document Object Model
document.getElementById ();
InnerHTML (); (select/table cannot be used directly )
Node
InnerText ();
Text
Document.childnodes child Nodes [ including element nodes and text nodes ]//contains text in addition to standard elements
Event
Definition : Interaction between user and page
Handling of events
- Traditional : Assignment Operation , The original does not exist
- Now : add to the inside ( Disadvantage browser problem )
Event classification
- Mouse
MouseDown, MouseUp, MouseOver, mouseout
- Keyboard
KeyDown, KeyPress, KeyUp
- Html
Load, focus, blur, change, select
This event
This pass value
Event occurrence itself, low version IE (window.event)
Application section
- Control style
Background-color = = = BackgroundColor
Document.body.style.backgroundColor
Document.body.className
- Regular expressions
/^ Start $ end/
- *: Matches 0 to N characters
- +:1 to N characters
- ?: 0 to 1
- {} scope
- [789] can be 7 for 8 9,[m-n] range
\. Enter a decimal point
Regular Expressions: Inefficient execution
Jquery
$===jquery
GT () In addition to the above
<form action= "" method= "Post/get" ></form>
Post submissions are not displayed in the navigation bar
Get submissions are displayed in the navigation bar above
JS get form
- document.getElementById ();
- Document.getelementsbynames () [];
- document.getElementsByTagName () [];
- document.forms[0]/document.forms[]
- Document.
- Document.body.childNodes then uses the loop to determine whether the form element
JQuery get form
- $ (ID);
- $ (Class:eq ());
- $ ("from"). EQ ();
- $ ("action=": eq () ")
Input Type Property
- Text
- Botton
- File
- Radio
- Password
- Hidden
- Submit
- Reset
- Checkbox
- Image
Select
Textarea
Jquery-ui
Simple summary of JS knowledge points