Home / Programs / Writing into an window alert box using Javascript
🚀 Programming Example

Writing into an window alert box using Javascript

👁 318 Views
💻 Practical Program
📘 Step Learning
Writing into an window alert box using Javascript

💻 Program Code

<!DOCTYPE html>
<html>
<body>

<h2>Writing into an window alert box</h2>
<p>My first paragraph.</p>

<script>
window.alert(10 + 6);
</script>

</body>
</html> 

                        

🖥 Program Output

 <h3>Live Preview </h3>
<div class="shadow">
<img src="/library/images-tutorials/html-browser.png" class="img-thumbnail">
<div class="ratio ratio-16x9">
    <iframe class="embed-responsive-item" src="/library/javascript/overview-of-javascript/window-alert-box-using-javascript-q-1022.html"></iframe>
  </div>
</div> </div>
<hr> 
                            

📘 Explanation

When you will refresh this page one alert will be open with output value.

📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.