inotgo.com


Tool version compatibility problem
JavaScript For interaction between web pages and users , For example, when submitting , Judge whether the user name is empty .

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
Correct

Example 1 : Through javascript Output text to document   
Example 2 : javascript and DOM A simple example of combination   
Example 3 : Fundamentals of language ,BOM and DOM   

Example 1 :

Through javascript Output text to document

edit top fracture
document yes javascript Built in objects , Represents the document part of the browser
document.write("Hello Javascript"); Write a string to the document
Operation effect
<script> document.write("Hello Javascript"); </script>
<script>
  document.write("Hello Javascript");
</script>


Source code
1. Double click the selected word 2. Triple Click to select the entire row 3. CTRL+F Find 4. F8 Full screen editing , Click restore again
Rendering Rendering complete
effect
Example 2 :

javascript and DOM A simple example of combination

edit top fracture
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
Operation effect
<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>


Source code
1. Double click the selected word 2. Triple Click to select the entire row 3. CTRL+F Find 4. F8 Full screen editing , Click restore again
Rendering Rendering complete
effect
Example 3 :

Fundamentals of language ,BOM and DOM

edit top fracture
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
 Fundamentals of language ,BOM and DOM


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 ?
woshi0CAI

Why is there no video ?







The answer has been submitted successfully , Auditing . Please My answer Check the answer record at , thank you
answer Or code please Fill in at least one , If you have a problem , Please ask again , Otherwise, the webmaster may not see




2019-06-21 put questions to
Good study

javascript Where to write ?




8 One answer

hhhzt
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
Answer time :2019-10-17
 Write in <script></script>  Inside the label 

I will study hard JAVA of
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
Answer time :2019-08-27
Write in <body> Front or back , Usually write after

yuxiwang
Answer time :2019-08-21
IDEA

fyn
Answer time :2019-08-14
Write in <script> In here </script>, Or create it separately js File

MrYang123
Answer time :2019-08-13
Just use Notepad

Gao Lingyi
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
answer Or code please Fill in at least one , If you have a problem , Please ask again , Otherwise, the webmaster may not see




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
about Front end part -JavaScript-Hello JavaScript Your questions

Try to provide Screenshot code and Abnormal information , Help to analyze and solve problems . You can also enter this station QQ Group communication : 496725845
Ask questions and try to provide complete code , Environment description , The more conducive to the recurrence of the problem , The faster your question can be answered .
Have questions about the code in the tutorial , Please provide which step , Which line is in doubt , This makes it easy to quickly locate the problem , Improve the speed at which questions are answered
In the thousands of questions that already exist , A considerable proportion , Because of the use of and webmaster Different versions of the development environment Resulting in , For example jdk, eclpise, idea, mysql,tomcat Wait, the version of the software is inconsistent .
Please use the same version as the webmaster , You can save yourself a lot of learning time . The webmaster sorted out the software versions used in teaching , It's all here , Convenient for everyone to download : /k/helloworld/helloworld-version/1718.html

Upload screenshot