Notepad is a built-in text editor that comes pre-installed on Windows machines of all versions – XP, Windows 7, Windows 8, Windows 10, and
so on. It is the default Windows text editor. You can think of Notepad as your VS Code or favorite text editor with fewer capabilities. Coding with Notepad is great for beginners, because you have no access to syntax highlighting, formatting, and other such automated features. Without these aides, you'll learn attention to detail, perseverance, resilience, and how to format your code yourself, before you start coding with other text editors like VS Code, Sublime Text, or
Atom. So, in this article, I will walk you through how to use Windows Notepad, and how to open any web page code with it by making a simple website with HTML, a little bit of CSS, and JavaScript. You can use Notepad to code in two ways: launch Notepad directly from your Windows machine and start coding and then save the code later, or create the file and open it with Notepad. In this tutorial, I will
focus on the second method, so I’m going to create the files first, then open them with Notepad. Step 1: Create a folder anywhere on your computer Step 3: Inside the folder, create an HTML file called These names are due to convention. You can name the files whatever you want if you don’t want to follow the conventions. Step 4: Right-click on the By default, the index.html file will be opened by your default browser, so make sure you don’t double-click the file. If Notepad is not shown within the options, click “Choose another app”, select “More apps” in the next popup, and you will see Notepad within the apps listed. Now, you should have opened the HTML file with Notepad. You will see something like this (if you get things right): Step 5: Paste in the following HTML Code:
Your Notepad app should now be filled with code: Save the file by pressing Ctrl + S, or go to File and click “Save”. If your code isn't indented like mine, don’t worry. Notepad doesn’t do it for you automatically, so you have to do it manually. Step 6: Now the HTML file is ready. Go back to the folder in which you created the HTML, CSS, and JavaScript files in Step 3. Double-click the HTML file to open it in your default browser. The website should now look like this: Open the CSS file you created in Step 3 and paste in the following code:
If you reload the page, you will see there are no changes. Don’t worry at all. This is because the Now, you can insert some text into that Open the JavaScript file created in Step 3 and paste in the following code:
What is the JavaScript code above doing? I declared a variable called I declared another variable called In the third line of the JavaScript code, I used the DOM’s Now, go back to the website and reload it. There’s still no difference. Don’t worry once again. This is because you have to link the CSS and JavaScript files. To link the CSS file, paste the following code in the head section of the HTML:
To link the JavaScript file, paste in the code below right before the closing body tag in the HTML:
The HTML file should now have the CSS and JavaScript files linked like this:
If you now reload the page, you should see a difference: The code in the CSS and JavaScript files is now working. ConclusionThe Windows Notepad is a text editor just like S Code, Atom, Sublime Text, and others. It just does not have the features of other more advanced text editors like syntax highlighting, text formatting, built-in terminal, and so on. But it still performs all the functions of a text editor as you can code in any programming language with it. To get more comfortable coding, you can download and install a more feature-rich text editor like VS Code (it's free!). It gives you syntax highlighting, text formatting, and pretty much any functionality you want through a rich library of extensions available in the VS Code marketplace. Apart from VS Code, other text editors you can use are Atom, Sublime Text, Vim, and Notepad++, a hybrid version of Windows Notepad. Thank you for reading this article. If you find it helpful, share it with your friends and family. Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started Which of the following file extension indicates the file is an HTML document?html indicates a file that uses HTML (HyperText Markup Language) or XHTML (EXtensible HyperText Markup Language). Windows/DOS required three-character file extensions, which gave rise to the . htm extension. This also references HTML and XHTML files and can be used on any web server, regardless of the operating system.
What HTTP method does a browser use when you upload files to a specific Web address?In computing, POST is a request method supported by HTTP used by the World Wide Web. By design, the POST request method requests that a web server accept the data enclosed in the body of the request message, most likely for storing it. It is often used when uploading a file or when submitting a completed web form.
Which type of cookie is set by a site other than the one you connected to?Third-Party Cookies
Third-party cookies are placed by other domains and not the ones a user visited directly. This happens when a user visits a website that has a third-party cookie file, for example, in the form of an ad.
Which of the following is the technique for improving the ranking and visibility of a Web site?Search engine optimization is the science of improving a website to increase its visibility when people search for products or services. The more visibility a website has on search engines, the more likely it is that brand captures business.
|