Hello, I hope you all are enjoying the tasty and yummy toasts.

In next few toast we are going to do some particle. We will start with writing some stuff in main html document and then we will do some mathematical operations and concatenation.

Let’s run your favorite code editor and open a new html file. This time I am doing some styling to my file and it looks something like this:

initialDoc


<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Writting to the Document</title>

<style>------ </style>

</head>

<body>

<div class="wrapper">

<div class="heading">

<h1> Learning JavaScript with Web Toasts </h1>

</div>

<div class="main">

<h2>Writting in Document</h2>

<hr>

</div>

&nbsp;

<div class="footer">

Learning Js with Web Toast,by <a href="">Mubashar Mehmood</a> with <a href="">Web Toasts</a>

</div>

</div>

</body>

</html>

Open a script tag in main div

opening-js-tag

opening-js-tag

Now write this statement in script tag :


document.write("<p>Web toasts are awesome</p>");

Like the alert() function, document.write() is a JavaScript command that in a sense writes out whatever you place between the opening and closing parentheses. It would be any html tag as well.

Here would be the final result:

writting-in-document

writting-in-document

In next lessons we would jump to the conditional statements. Subscribe to web toast for more good stuff. We promise to not spam you.