1. The full HTML page label must have
< HTML > < Head > < charset= ""> //General need to specify the encoding language </Head > <body></body> </ HTML >
2. html page embedding JS code in two ways
Method one:<type= "Text/javascript"></script >
Method Two: <script type= "Text/javascript" src= "" ></scripts>
3. HTML pages embed CSS code in two ways
method One:< style type= "Text/css" ></ style >
Method Two: <link rel= "stylesheet" href= "CSS location" type= "Text/css" >
One of the rel= "stylesheet" in the link tag defines an external style sheet
4. JQuery
4.1 The following function cannot be omitted, it is $ (document). The abbreviation for Ready (function () {}), which means that the code inside the function can be executed after the HTML page is loaded
$ (function() {
})
4.2 For labels that are not button,div input type, you need to use text () to get the contents between tags, or you can set the Value property for the button and get the value values using the Val () function. Like what
<val= "button"></button>
$ ("button"). Click (function () {
$ ("button"). val ()); Eject button
Alert ($ ("button"). text ());//Eject I know
})
4.3 using jquery to get the right to use tags
There are three main categories: the original HTML element selector, with the class selector and the ID selector in the tag, such as:
<val= "button"></button>
$ ("button"). Click (function() {//This is the HTML original label}) $ ("#ha"). Click (function() { ID Selector}) $ (". Hi"). Click (function() {//class selector})
Front-end HTML and tags