HTML Document on a Mac

Before I buy the book - I would like to make certain that I can use it on my iMac. So I am quoting the following from the sample version of the book that shows in iBooks -

The first thing that you need is an HTML document. This document will host the JavaScript that you will be writing.

So is this HTML document something that I can create on my iMac? There aren’t any instructions as to how I might be able to do this so I’m a bit apprehensive that I’ll purchase the book and then not be able to use it because I can’t create this HTML on my iMac. Please assuage my fears that the book is compatible with the iMac.

Hey John, you can do everything in the book on your iMac. Kirupa put together a list of apps you can use to make HTML documents here:

All of those are free, but if you want to stick to just apps from Apple, you could follow along with Xcode, TextEdit, or Terminal.

To add to what Kril mentions, this article will help you to create a HTML document:

The editor I am using is Visual Studio Code, but you can use any editor. The main thing to make sure is that you save your files with the extension .htm or .html. That extension tells macOS to open that file in your browser when you try to open it :slightly_smiling_face:

Let us know if you have any additional questions!


Thanks for the speedy responses from both of you. It’s reassuring to know that I’ll be able to implement code on the Mac. I’m going to start off with the “getting your feet wet” link and see if I have the wherewithal to get the final result in the tutorial.

Sorry - I forgot to mention that the above takes place in Visual Studio Code - so when I am asked to - select editor for untitled - 1 - is this where I name the file - hello_world.htm - as suggested in the tutorial ?

This is a fairly new feature and I think confusing, especially if you only have one editor (which you do). Basically it allows you to pick which editor you want to use for new files. Since you only have one (“Text Editor”) thats all you can pick, so the choice is easy for you.

The box to type in is just a filter to help you find more editors if you have more installed.

Normally you wouldn’t see this. For example if you used the keyboard shortcut to make a new file (CTRL/CMD + N) it wouldn’t appear. And if you’re editing existing files, it would automatically choose what’s right for editing that file… though you might see this then if you have multiple editors that support that specific file type. Most of the time, though, you’re just editing text files.

Thanks for that speedy response - is Text Editor the same as
Screen Shot 2020-07-14 at 10.47.54 AM

No, TextEdit is a separate program on your computer. The “editors” in this context (in the context of VS Code, another program on your computer) are internal to the program itself. The program VS Code can internally have different editors for modifying files. The “Text Editor” is the standard editor for editing text files within VS Code.

OK - thanks for the detail.