Home > Web Front-end > JS Tutorial > body text

JavaScript study notes organization (overview, introduction to variables, data types)_Basic knowledge

WBOY
Release: 2016-05-16 15:35:08
Original
1420 people have browsed it

A. Overview
1. Output tool:

document.write()---can be html

alert()---string

prompt(text,defaultText)
text---optional. Plain text (not HTML-formatted text) to be displayed in the dialog box.
defaultText---optional. Default input text.

Placement of 2.js

a. Can be placed anywhere in HTML

b. But they are a whole and influence each other

c. At the location of hyperlinks and redirects

<a href="javascript:alert();"></a>
<form action="javascript:alert();"></form>
<div onclick="alert()"></div>

********IE下可行,不推荐使用********
<div id="one"></div>
<script for="one" event="onclick">
alert(111);
</script>
Copy after login

d. Call external javascript files

​1. No code can appear in the calling js tag
2. The

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template