JS basics--several ways to output messages

(1) alert() pops up a dialog box on the page, used for early JS debugging.


(2) Confirm() A dialog box pops up on the page, which is often used with if judgment.


(3) console.log() Input information to the console for js debugging.


(4) prompt() pops up a dialog box to receive information entered by the user.


(5) document.write() outputs messages on the page /*document.write can not only output information, but also output tags. */

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324490331&siteId=291194637