SimpleTuts.com

Outputs in JavaScript

In JavaScript, an output typically refers to updating the DOM (Document Object Model), or interacting with users through alerts or prompts or displaying or logging information to the console. Here are some common ways to produce output


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Outputs in JavaScript</title>
</head>

<body>
    <h1 id="demo"></h1>
    <script>
        document.getElementById('demo').innerHTML = "Hello friends";
        document.write("<h3>I am learning JavaScript</h3>");
        window.alert("I like JavaScript");
        console.log("Can you find me?");
    </script>
</body>
</html>  
Run Code