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

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