Creating your first JavaScript part 1

Your First JavaScript



Let's start with adding JavaScript to a webpage.
JavaScript on the web lives inside the HTML document. 
In HTML, JavaScript code must be inserted between <script> and </script> tags:<script>
...
</script>

JavaScript can be placed in the HTML page's <body> and <head> sections.
In the example below, we placed it within the <body> tag.
Remember that the script, which is placed in the head section, will be executed before the <body> is rendered. If you want to get elements in the body, it's a good idea to place your script at the end of the body tag.
What tag contains the JavaScript code?
script ans
code
body
style


Comments