How to a display status window in JavaScript

I am up with another tutorial of JavaScript. In this tutorial, we will learn how to display a status window in JavaScript. You must have noticed that whenever you fill any form in a website there is some message on the status window at the bottom of the window.

So let’s begin with the tutorial. This property is different from the default status property which displays text in the status window at the top of the page. It is useful for displaying errors in the form filled by the user.

Code to display status window in JavaScript

function ab()
var x,y,st
st="fill password to complete the details"
window.status="fill name"
w=" "
w=w+ st.charAt(i)
<form name="fr">
enter name
<input type="text" name="t1">
<br>enter password
<input type="password" name="t2">
<br><input type="text" name="t3">
<br><input type="button" value="click n see" onClick="ab()">

We have used the basic structure of writing JavaScript code. So our code is divided into two sections one is the script part which contains all the mathematical coding part. And the other is the form part which contains the front end part.

window.statusĀ is used to display the status. First, we check if the name field is empty is not if it is empty then we display fill name status in the status window. But if the length of the password is empty. So we run a for loop from zero to string length and we keep adding character by character by charAt() function.

We run another for loop in j from 10 to 10000 to create a time lag in displaying the status. And later we assign the value of w to t3. In the form part, we make three text boxes among which the first two are input text boxes. And the last one is an output text box which the output if you press the button without entering the password so it displays a message that “fill password to complete your details“.

I hope you understood the code well. Feel free to ask your doubts in the comments section below.

You may also read,

Leave a Reply

Your email address will not be published. Required fields are marked *