Tool version compatibility problem
JavaScript For interaction between web pages and users , For example, when submitting , Judge whether the user name is empty .
Correct
complete javascript from Fundamentals of language , BOM and DOM form . This module mainly explains javascript Language itself and BOM, DOM Please refer to HTML DOM Example 2 : javascript and DOM A simple example of combination Example 3 : Fundamentals of language ,BOM and DOM
document yes javascript Built in objects , Represents the document part of the browser
document.write("Hello Javascript"); Write a string to the document
<script> document.write("Hello Javascript"); </script>
<script> document.write("Hello Javascript"); </script>
This is a javascript and DOM A simple example of combination
onclick="..." It means clicking button What you do later document.getElementById According to id Gets the specified element .style.display='none' Hide .style.display='block' Show ( To be exact , With block In the form of ) onclick,getElementById,style.display These contents , yes HTML DOM Knowledge and concepts that should not be used until
<button onclick="document.getElementById('text').style.display='none'"> Hide text </button> <button onclick="document.getElementById('text').style.display='block'"> Display text </button> <p id="text"> This is a paragraph that can be javascript Hidden text </p>
<button onclick="document.getElementById('text').style.display='none'"> Hide text </button> <button onclick="document.getElementById('text').style.display='block'"> Display text </button> <p id="text"> This is a paragraph that can be javascript Hidden text </p>
complete javascript from
Fundamentals of language ,
BOM and
DOM form .
Only through javascript Operation DOM Object time , Will bring good practical results , This chapter will only cover the basics of language and BOM part ,DOM Part in The next chapter open
The official account of programming , Follow and get the latest tutorials and promotions in real time , thank you .
![]()
Q & A area
2020-04-09
Why is there no video ?
The answer has been submitted successfully , Auditing . Please
My answer Check the answer record at , thank you
2019-06-21
put questions to
8 One answer
hhhzt Jump to the problem location Answer time :2020-12-17
Write in <script> Inside and save it as html Just file it , Follow me to write html The same operation , Of course, it can also be written separately js In the document
nnwan104532 Jump to the problem location Answer time :2019-10-17 Write in <script></script> Inside the label I will study hard JAVA of Jump to the problem location Answer time :2019-09-08
use <script> Wrap the label , Usually placed in head Inside , In fact, where to put it is a big problem , In fact, more will create a separate js File .
Baimu Jump to the problem location Answer time :2019-08-27
Write in <body> Front or back , Usually write after
yuxiwang Jump to the problem location Answer time :2019-08-21
IDEA
fyn Jump to the problem location Answer time :2019-08-14
Write in <script> In here </script>, Or create it separately js File
MrYang123 Jump to the problem location Answer time :2019-08-13
Just use Notepad
Gao Lingyi Jump to the problem location Answer time :2019-06-26
Write in <script> Inside
The answer has been submitted successfully , Auditing . Please
My answer Check the answer record at , thank you
2018-06-20
Example 2
2018-06-14
·······
2017-09-08
Example 2 code is useless ....
Too many questions , Page rendering is too slow , To speed up rendering , Only a few questions are displayed on this page at most . also 2 Previous questions , please Click to view
Please... Before asking questions land
The question has been submitted successfully , Auditing . Please
My question Check the question record at , thank you
|