A little Overview and fun

20 0 0
                                    

JavaScript on the web lives inside the HTML document.
In HTML, JavaScript code must be inserted between <script> and
</script> tags:

In HTML, JavaScript code must be inserted between <script> and </script> tags:

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.

JavaScript can be placed in HTML pages <body> and <head>
sections. For example

To send a alert message to device start code with alert

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.

To send a alert message to device start code with alert. Then add this ("")
In between those put in any message you want. For example

This would be the result:

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.

This would be the result:

For the message to be on the website add in document

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.


For the message to be on the website add in document.write("") and just like before, put your message between the ("")  for example:

write("") and just like before, put your message between the ("")  for example:

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.

The document.write() function writes a string into our HTML document. This function can be used to write text, HTML, or both.

The above code displays the following result:

The above code displays the following result:

Just like in HTML, we can use HTML tags to format text in JavaScript

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.

Just like in HTML, we can use HTML tags to format text in JavaScript.
For example, we can output the text as a heading.

For example, we can output the text as a heading

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.

Result:

Ok I'm not done yet I'm still learning but eventually it will get filled up

Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.



Ok I'm not done yet I'm still learning but eventually it will get filled up. Give me any tips with JavaScript if you can😁

You've reached the end of published parts.

⏰ Last updated: Jul 25, 2018 ⏰

Add this story to your Library to get notified about new parts!

JavaScript notebook Where stories live. Discover now