From the course: Learn JavaScript: Write Modern Code with JavaScript ESNext
Unlock this course with a free trial
Join today to access over 25,000 courses taught by industry experts.
Write a JavaScript program for the browser - JavaScript Tutorial
From the course: Learn JavaScript: Write Modern Code with JavaScript ESNext
Write a JavaScript program for the browser
- So we're going to start off by writing a JavaScript program that runs in the browser. And before we get into writing code, let's write a project folder and create the files we'll need. So let's create a new folder and we'll call it generate table browser. And we'll open that up. And now to run JavaScript code in the browser, what we have to do is actually put a script tag in an HTML file. So let's create a new file in this project and we'll call it index.html. And we're going to start off by just creating a very basic HTML file. It's going to look something like this. We're going to say doc type HTML, HTML, and then we'll have our head and body tags. And the place that we're going to actually put our JavaScript code is we're going to create a script tag inside our head tag and write it there. But first let's set up a very basic HTML page that'll let us enter how many rows and columns we want the multiplication table to contain. So what I'm going to do is just have a heading tag that…
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Learning objectives1m 55s
-
(Locked)
Learn about writing and running JavaScript programs1m 44s
-
(Locked)
Write a JavaScript program for the browser12m 4s
-
(Locked)
Move JavaScript to an external script1m 20s
-
(Locked)
Install Node.js and NPM1m 58s
-
(Locked)
Write a Node script5m 57s
-
(Locked)
Use Babel to transpile code3m 2s
-
(Locked)
-
-
-
-
-