- Using Console
- Using Dialog Box
- Writing to HTML Elements
- Writing to the Browser Window
Programming Examples of Using Console Output; –
You can see above console.log program. However, the output of console.log() cannot be seen on mobile devices because the developer console is only available on desktop devices browser like Firefox, Microsoft Edge and Firefox.
Using Dialog Box
In Dialog Box, we display output by using alert() function, we can output data on a dialog box, and it is work both mobile and desktop, Look below programming example.
Programming example using Dialog Box; –
If you run above programming example, then you can see a dialog box like given below;
This is the output of the above programming examples, print output using Dialog box.
Writing to HTML Elements
By using this Writing HTML Elements, innerHTML property, we can change the content or text of the selected elements.
We can use the document.getElementById() function to select an elements. Look below programming example to understand better.
Programming example of Inner HTML; –
You can see the above programming of Inner HTML coding, in output of this program if you click the button the sum of number is show over the button, like below output image.
This is the output of above programming examples; –
Writing to the Browser Window
By using the document.write() function to display the output. We can write to the content of the document. Now see the programming examples below to better understanding.
Programming examples of Displaying Browser Window; –
You can see above programming, in output of this program if you click the button when the sum of number (25) is print in the place of button. You can see below the output image.
Read Also –
- Learn Modern Computer Skills
- Learn all Tutorial of HTML With Programming Examples.
graliontorile · August 18, 2022 at 5:58 pm
What¦s Going down i’m new to this, I stumbled upon this I’ve discovered It absolutely useful and it has helped me out loads. I hope to give a contribution & assist other users like its helped me. Great job.
465 · December 12, 2022 at 7:23 pm
Woah! I’m really digging the template/theme of this blog.
It’s simple, yett effective. A lot of times it’s vry ard to get thwt “perfect balance” between suuperb
usabklity and appearance. I must say yyou have dlne a vvery gpod joob with
this. In addition, the blog lolads extremelyy fqst
for me onn Safari.Outstannding Blog!
zoritoler imol · January 3, 2023 at 1:31 pm
You have brought up a very wonderful details , appreciate it for the post.
Brian Reitler · January 16, 2023 at 9:28 am
Utterly composed content, thanks for selective information. “Life is God’s novel. Let him write it.” by Isaac Bashevis Singer.