Method of outputting information in JavaScript of Information Confirmation Box Prompt Input Box Document Flow Output

  • 2021-06-28 10:08:55
  • OfStack

The method for outputting information in js is as follows:

1. Document Stream Output


2. Output Information Tip Box Modal Dialog

window.alert(' To output what is displayed ');  or  alert(' To output what is displayed ');

3. Information Confirmation Box

var f = window.confirm(' Do you want to enter Sina? '); confirm("");
location.href = ''; 

4. Prompt Input Box

var n = window.prompt(' Please enter your age ',18);
document.write(' Welcome to your young people '); 

5. Control labels and output them directly on the labels.

Object labels are found by document.getElementById ('id'), which allows you to directly control the values inside and output them

setInterval (function(){document.getElementById('ttt').innerHTML = "Current Time:"+new Date().toLocaleString();},1000);

document.getElementById('uname').value = " nameless ";

6. Output the information directly to the title

document.title = "hello";

Related articles: