1 "Introduction JS
We just wrote the simple necessary HTML tag, never added a click event to the tag, this time the page adds events.
"is written to the HTML page and can be included in the
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <title>Yinana</title> 5<script type= "Text/javascript"> 6 D Ocument.write ("") 7 </ Script > 8 </Head>9 <Body> <script type= "Text/javascript">11 document.write ("") </script> - <Div> - This is the main content the </Div> - </Body> - </HTML>
"Written in JS file
You want to Ah, when the JS logic too much when the HTML JS code too much, the page clutter does not say, maintenance is particularly inconvenient to modify, so intelligent human to the JS code and HTML code separated out,
Write the code to the file at the end of the. js file, and the HTML page introduces an external JS file.
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <title>Yinana</title>5 <script src= "//cdn.bootcss.com/jquery/1.11.3/jquery.min.js" ></script>//introduction of external JS files 6 </Head>7 <Body>8 <Div>9 This is the main contentTen </Div> One </Body> A </HTML>
2 "The introduction of CSS style" ibid. js "
The difference is that the labels they use are different css= </style> tags js= <script> tags
1 <HTML>2 <Head>3 <styletype= "Text/css">4 H1{Color:Red}5 P{Color:Blue}6 </style>7 </Head>8 9 <Body>Ten <H1>Header 1</H1> One <P>A paragraph.</P> A </Body> - </HTML>
External CSS files, ending with. css files
1 <HTML>2 <Head>3 <link rel= "stylesheet" href= "//cdn.bootcss.com/ Bootstrap/3.3.5/css/bootstrap.min.css "> 4 </Head>5 <Body>6 ......7 </Body>8 </HTML>
Ok
"HTML" "2" HTML introduces external file JS CSS