current position:Home>JavaScript output data

JavaScript output data

2022-05-15 04:29:00The evening wind blows

One 、 Display the data

How data is displayed :
document.write() Method to write the content to HTML file
window.alert() Pop up warning box
innerHTML Write to HTML Elements
console.log() Write to the browser's console

Two 、 Output application

The code is as follows ( Example ):

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
<p id="p"> I'm a paragraph </p>
<script> document.write("<h1> first JavaScript</h1>"); window.alert("warning: Please press OK "); document.getElementById("p").innerHTML= "i am a epic"; log = " Output and look at the log " console.log(log) </script>

3、 ... and 、 The output shows

 Insert picture description here
 Insert picture description here

copyright notice
author[The evening wind blows],Please bring the original link to reprint, thank you.

Random recommended