JavaScript on the web lives inside the HTML document.
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
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
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:
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:
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:
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.
Oops! This image does not follow our content guidelines. To continue publishing, please remove it or upload a different image.
Result:
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 ARE READING
JavaScript notebook
RandomThis is just a notebook about the codes I'm learning. But if you like you can read it to😁
