{"id":11428,"date":"2022-06-22T07:00:59","date_gmt":"2022-06-22T14:00:59","guid":{"rendered":"https:\/\/www.codingdojo.com\/blog\/?p=11428"},"modified":"2022-06-22T07:00:59","modified_gmt":"2022-06-22T14:00:59","slug":"how-to-add-javascript-to-html","status":"publish","type":"post","link":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html","title":{"rendered":"How to Add JavaScript to HTML In 2 Easy Steps"},"content":{"rendered":"\n<p><span style=\"font-weight: 400;\">A <\/span><a href=\"https:\/\/www.codingdojo.com\/blog\/8-benefits-of-being-a-web-developer\"><span style=\"font-weight: 400;\">successful career as a web developer<\/span><\/a><span style=\"font-weight: 400;\"> starts with a solid foundation in computer programming and mastering key programming languages. One of these programming languages is JavaScript.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">JavaScript has been used to build some of the world\u2019s most popular websites and apps, which is why web developers who can code in this language are in such high demand.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This article will show you <\/span>how to add JavaScript to HTML in two easy steps<span style=\"font-weight: 400;\">. We\u2019ll also cover the fundamentals of JavaScript and examine its many uses in the tech world.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">What Is JavaScript?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">JavaScript (or JS) is <\/span>a scripting or programming language that lets you implement dynamic and interactive elements on web pages.<span style=\"font-weight: 400;\"> JS is also used to<\/span> build web apps and browser games<span style=\"font-weight: 400;\">. It\u2019s versatile enough for various applications, including servers, hardware controls, and software.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">JavaScript facilitates interactions between the user\u2019s web browser and the website the user is visiting. All major web browsers have a dedicated JavaScript engine to execute JS code on users\u2019 devices.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Essentially, JavaScript prevents web pages from being static and allows developers to add dynamic and interactive elements to web pages. Some examples include inserting animation, audio, and video into web pages (with stop, pause, and play buttons) and automatically placing the text cursor into the search box when loading Google Search.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Together with HTML and CSS, JavaScript is part of the <\/span><a href=\"https:\/\/www.codingdojo.com\/blog\/how-to-learn-html-css-java\"><span style=\"font-weight: 400;\">three core technologies needed to build websites<\/span><\/a><span style=\"font-weight: 400;\">. <\/span><a href=\"https:\/\/www.codingdojo.com\/blog\/what-is-html\"><span style=\"font-weight: 400;\">HTML (which stands for HyperText Markup Language)<\/span><\/a><span style=\"font-weight: 400;\"> provides structure to web content. Examples include defining headings, data tables, and lists of bulleted points.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">CSS (Cascading Style Sheets) applies styling and layout to HTML content. Examples include setting background and font colors, standardizing spacing between elements, and adding background images.\u00a0\u00a0\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Even though Java and JavaScript have similar syntax and standard libraries, these two programming languages are quite different\u2014with Java being an OOP <\/span><i><span style=\"font-weight: 400;\">programming<\/span><\/i><span style=\"font-weight: 400;\"> language (i.e., runs in a virtual machine or browser). On the other hand, JavaScript is an OOP <\/span><i><span style=\"font-weight: 400;\">scripting<\/span><\/i><span style=\"font-weight: 400;\"> language (i.e., it runs in the browser only).\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Check out our insightful blog post if you want to <\/span><a href=\"https:\/\/www.codingdojo.com\/blog\/what-is-javascript\"><span style=\"font-weight: 400;\">learn more about JavaScript<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">What Is JavaScript Used For?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">You can use JavaScript <\/span><b>to <\/b>build complex websites, browser games, and apps. <span style=\"font-weight: 400;\">You can <\/span>also use it to connect servers to websites and web apps<b>.<\/b><span style=\"font-weight: 400;\"> Many of the most widely-used websites and apps on the internet use JavaScript\u2014including Facebook, Netflix, Google, and YouTube.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Numerous technologies have sprung up in recent years to leverage the power of JavaScript. JS now has an extensive collection of frameworks that you can use to build mobile and web apps.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Frameworks are libraries of pre-written JS code. They function similarly to blueprints and help developers build apps and websites with greater functionality.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">These are the three most popular JS application frameworks:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/reactjs.org\/\"><span style=\"font-weight: 400;\">React<\/span><\/a><span style=\"font-weight: 400;\">, which you can use to build user interfaces for web apps\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/reactnative.dev\/\"><span style=\"font-weight: 400;\">React Native<\/span><\/a><span style=\"font-weight: 400;\">, which you can use to build mobile apps\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/nodejs.org\/en\/\"><span style=\"font-weight: 400;\">Node.js<\/span><\/a><span style=\"font-weight: 400;\">, which enables two-way communication with servers for data exchange\u00a0<\/span><\/li>\n<\/ul>\n<p><b>JavaScript is needed to make web pages dynamic and interactive. <\/b><span style=\"font-weight: 400;\">With JS baked into their coding, developers can implement the following features:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display timely and relevant content updates<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display interactive maps<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Insert drop-down and hamburger-style menus\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Play audio and video<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Zoom in and out of images<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Add 2D\/3D graphics and animation<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display image galleries in a carousel format<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Insert hover effects<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display and hide menus\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Alert users to invalid characters when typing passwords<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">JS is also used to create elaborate in-browser games. Some of the most popular browser-based games in the world use JS, including Angry Birds, Bejeweled, and Tetris.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Due to its versatility and ubiquity as a web development tool, JavaScript remains the most widely used programming language among developers, according to Statista. In 2021, <\/span><a href=\"https:\/\/www.statista.com\/statistics\/793628\/worldwide-developer-survey-most-used-languages\/\"><span style=\"font-weight: 400;\">nearly 65% of developers used JavaScript<\/span><\/a><span style=\"font-weight: 400;\">. What\u2019s more, an overwhelming <\/span><a href=\"https:\/\/w3techs.com\/technologies\/details\/cp-javascript\/\"><span style=\"font-weight: 400;\">98% of websites use JS on the client side<\/span><\/a><span style=\"font-weight: 400;\"> to handle web page behavior, according to W3Techs.\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">How to Add JavaScript to HTML<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">We\u2019ve already explored how HTML, CSS, and JavaScript are needed to build functional and dynamic web pages. A cool metaphor would be to think of your website as a three-layered cake\u2014with HTML as the foundation, CSS as the middle layer, and JavaScript as the top layer.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You first structure your content on the web page with HTML, then add stylistic elements and a proper layout with CSS. Next, you need to add dynamic and interactive functions with HTML.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are <\/span>two ways to add JavaScript to HTML<span style=\"font-weight: 400;\">: the first is <\/span>to embed inline JS code into HTML<span style=\"font-weight: 400;\">, while the second requires you to <\/span>create an external JS file<span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">1. Embed Inline JavaScript Code in HTML<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">When working with files for the internet, JS needs to be loaded and run alongside HTML markup. You can do this inline within an HTML document. <\/span><a href=\"https:\/\/docs.google.com\/document\/d\/1JrsE3SD0nYBB2M5_XuECus_VTC1JcPHrdb3yUFpPQjw\/edit#heading=h.62hmfmm05o15\"><span style=\"font-weight: 400;\">Click here for the steps<\/span><\/a><span style=\"font-weight: 400;\"> to do that.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">2. Create an External JavaScript File<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Another way to load JS and run it alongside HTML markup is to create an external JS file. The browser will download this JS file alongside the HTML document when a user visits a web page. <\/span><a href=\"https:\/\/docs.google.com\/document\/d\/1JrsE3SD0nYBB2M5_XuECus_VTC1JcPHrdb3yUFpPQjw\/edit#heading=h.pb6ip6ltcsy3\"><span style=\"font-weight: 400;\">Click here for the steps<\/span><\/a><span style=\"font-weight: 400;\"> to include external JavaScript.\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">How to Embed Inline JavaScript Code<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">JavaScript code can be embedded inline into an HTML document by using the dedicated HTML tag <\/span><span style=\"font-weight: 400;\">&lt;script&gt;<\/span><span style=\"font-weight: 400;\">. This HTML tag wraps around the JS code.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The<\/span><span style=\"font-weight: 400;\"> &lt;script&gt; <\/span><span style=\"font-weight: 400;\">tag can be placed either in the <\/span><span style=\"font-weight: 400;\">&lt;head&gt;<\/span><span style=\"font-weight: 400;\"> section of your HTML or in the <\/span><span style=\"font-weight: 400;\">&lt;body&gt;<\/span><span style=\"font-weight: 400;\"> section. The placement entirely depends on when you want the JS code to load.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Add Javascript in the &lt;Head&gt; Tags<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">JS code can be inserted inside the HTML document\u2019s <\/span><span style=\"font-weight: 400;\">&lt;head&gt; <\/span><span style=\"font-weight: 400;\">section. You do this to keep the function contained and away from the main content of your HTML document.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This <\/span><a href=\"https:\/\/www.w3schools.com\/js\/js_whereto.asp\"><span style=\"font-weight: 400;\">sample code from W3Schools<\/span><\/a><span style=\"font-weight: 400;\"> shows you how to add the <\/span><span style=\"font-weight: 400;\">&lt;head&gt;<\/span><span style=\"font-weight: 400;\"> tag into the <\/span><span style=\"font-weight: 400;\">HTML document\u2019s <\/span><span style=\"font-weight: 400;\">&lt;head&gt; <\/span><span style=\"font-weight: 400;\">section:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">!DOCTYPE<\/span><span style=\"font-weight: 400;\"> html<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">html<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">script<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">function<\/span><span style=\"font-weight: 400;\"> myFunction() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0document.getElementById(<\/span><span style=\"font-weight: 400;\">&#8220;demo&#8221;<\/span><span style=\"font-weight: 400;\">).innerHTML = <\/span><span style=\"font-weight: 400;\">&#8220;Paragraph changed.&#8221;<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/script<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/head<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">body<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">h2<\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\">Demo JavaScript in Head<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/h2<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">p<\/span><span style=\"font-weight: 400;\"> id<\/span><span style=\"font-weight: 400;\">=&#8221;demo&#8221;&gt;<\/span><span style=\"font-weight: 400;\">A Paragraph<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/p<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">button<\/span><span style=\"font-weight: 400;\"> type<\/span><span style=\"font-weight: 400;\">=&#8221;button&#8221;<\/span><span style=\"font-weight: 400;\"> onclick<\/span><span style=\"font-weight: 400;\">=&#8221;myFunction()&#8221;&gt;<\/span><span style=\"font-weight: 400;\">Try it<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/button<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/body<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/html<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">Try and <\/span><a href=\"https:\/\/www.w3schools.com\/html\/tryit.asp?filename=tryhtml_intro\"><span style=\"font-weight: 400;\">run it on W3Schools\u2019s free HTML editor<\/span><\/a><span style=\"font-weight: 400;\">. You\u2019ll notice that it calls the function when the button \u201cTry It\u201d is clicked.\u00a0<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Add Javascript in the &lt;Body&gt; Tags<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">If your script needs to run at a specific point within your web page\u2019s layout, you\u2019ll need to insert it at the point where it should call the function. The placement is usually within the<\/span><span style=\"font-weight: 400;\"> &lt;body&gt;<\/span><span style=\"font-weight: 400;\"> section.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this <\/span><a href=\"https:\/\/www.w3schools.com\/js\/js_whereto.asp\"><span style=\"font-weight: 400;\">sample code from W3School<\/span><\/a><span style=\"font-weight: 400;\">, the JS function is placed in the <\/span><span style=\"font-weight: 400;\">&lt;body&gt;<\/span><span style=\"font-weight: 400;\"> section of the HTML document:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">!DOCTYPE<\/span><span style=\"font-weight: 400;\"> html<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">html<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">body<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">h2<\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\">Demo JavaScript in Body<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/h2<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">p<\/span><span style=\"font-weight: 400;\"> id<\/span><span style=\"font-weight: 400;\">=&#8221;demo&#8221;&gt;<\/span><span style=\"font-weight: 400;\">A Paragraph<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/p<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">button<\/span><span style=\"font-weight: 400;\"> type<\/span><span style=\"font-weight: 400;\">=&#8221;button&#8221;<\/span><span style=\"font-weight: 400;\"> onclick<\/span><span style=\"font-weight: 400;\">=&#8221;myFunction()&#8221;&gt;<\/span><span style=\"font-weight: 400;\">Try it<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/button<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">script<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">function<\/span><span style=\"font-weight: 400;\"> myFunction() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0document.getElementById(<\/span><span style=\"font-weight: 400;\">&#8220;demo&#8221;<\/span><span style=\"font-weight: 400;\">).innerHTML = <\/span><span style=\"font-weight: 400;\">&#8220;Paragraph changed.&#8221;<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/script<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/body<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">\/html<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">When you <\/span><a href=\"https:\/\/www.w3schools.com\/html\/tryit.asp?filename=tryhtml_intro\"><span style=\"font-weight: 400;\">run the code on W3Schools\u2019s free HTML editor<\/span><\/a><span style=\"font-weight: 400;\">, you\u2019ll see the function called when the button \u201cTry It\u201d is clicked.\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">How to Include External JavaScript in HTML<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If your script is large or you need to spread it across several web pages, you would usually add\u00a0 the JS code to one or more JavaScript files, which are referenced within HTML documents.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Using separate JS files allows developers to separate the HTML markup from the JS code, preventing any confusion. It also makes ongoing maintenance easier and allows web pages to load more quickly when caching JS files.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is the sample external <\/span><a href=\"https:\/\/www.w3schools.com\/js\/js_whereto.asp\"><span style=\"font-weight: 400;\">JS script, as provided by W3School<\/span><\/a><span style=\"font-weight: 400;\">:\u00a0<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">function<\/span><span style=\"font-weight: 400;\"> myFunction() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0document.getElementById(<\/span><span style=\"font-weight: 400;\">&#8220;demo&#8221;<\/span><span style=\"font-weight: 400;\">).innerHTML = <\/span><span style=\"font-weight: 400;\">&#8220;Paragraph changed.&#8221;<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">To use this external script, you\u2019ll need to add the name of the script file in the <\/span><span style=\"font-weight: 400;\">src<\/span><span style=\"font-weight: 400;\"> (source) attribute of a <\/span><span style=\"font-weight: 400;\">&lt;script&gt;<\/span><span style=\"font-weight: 400;\"> tag:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">script<\/span><span style=\"font-weight: 400;\"> src<\/span><span style=\"font-weight: 400;\">=&#8221;myScript.js&#8221;&gt;&lt;<\/span><span style=\"font-weight: 400;\">\/script<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">Note that JS files should have the file extension \u201c.<\/span><b>js<\/b><span style=\"font-weight: 400;\">\u201d.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The external script can be placed in either the <\/span><span style=\"font-weight: 400;\">&lt;head&gt; <\/span><span style=\"font-weight: 400;\">or <\/span><span style=\"font-weight: 400;\">&lt;body&gt; <\/span><span style=\"font-weight: 400;\">section of the HTML document.\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Tips for Adding JavaScript to HTML<\/span><\/h2>\n<ul>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">You should add functions to the<\/span> <span style=\"font-weight: 400;\">&lt;head&gt;<\/span> <span style=\"font-weight: 400;\">section<\/span> if scripts should only be triggered when they\u2019re called or an event is triggered. <span style=\"font-weight: 400;\">This way, the script doesn\u2019t interfere with your page&#8217;s content.<\/span><\/li>\n<\/ul>\n<ul>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">If your script<\/span> writes page content, it should be within the <span style=\"font-weight: 400;\">&lt;body&gt;<\/span> section<b>. <\/b><span style=\"font-weight: 400;\">Ideally, the script should be at the bottom of the <\/span><span style=\"font-weight: 400;\">&lt;body&gt;<\/span><span style=\"font-weight: 400;\"> section to improve page load speeds.<\/span><\/li>\n<\/ul>\n<ul>\n<li aria-level=\"1\">If your website uses HTML5<b>,<\/b><span style=\"font-weight: 400;\"> adding JS script in the<\/span> <span style=\"font-weight: 400;\">&lt;script&gt;<\/span> <span style=\"font-weight: 400;\">tag isn\u2019t required.\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Some programmers recommend keeping your HTML, CSS, and JS scripts in separate folders. <\/span><a href=\"https:\/\/betterprogramming.pub\/link-css-and-js-files-with-html-file-f848d00b42e8\"><span style=\"font-weight: 400;\">Just make sure to link them correctly. <\/span><\/a><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Learn JavaScript at Coding Dojo<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Becoming proficient in JavaScript and other widely-used programming languages opens up numerous career opportunities. Tech giants and innovative startups are always on the lookout for great coders. Or, if you\u2019re interested in forging your own path, you could use your programming skills to create the next disruptive app or service.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Join our free workshop, <\/span><a href=\"https:\/\/www.codingdojo.com\/intro-to-web-development\"><span style=\"font-weight: 400;\">Intro to Web Development<\/span><\/a><span style=\"font-weight: 400;\">, if you want to learn the coding basics \u2013 including JavaScript.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Or, if you\u2019re interested in diving into our software development curriculum, <\/span><a href=\"https:\/\/www.codingdojo.com\/coding-bootcamp\"><span style=\"font-weight: 400;\">check out our Software Development Bootcamp<\/span><\/a><span style=\"font-weight: 400;\">. You\u2019ll learn all the major programming languages, including JavaScript, and equip yourself with the skills needed to become a full-stack web or software developer.\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/www.codingdojo.com\/apply\"><span style=\"font-weight: 400;\">Apply now and start your journey<\/span><\/a><span style=\"font-weight: 400;\"> with Coding Dojo.\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">JavaScript in HTML FAQ<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">What Does JavaScript Do?<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">JavaScript (JS) is a programming language you can use to implement dynamic and interactive elements on web pages. Together with HTML and CSS, JavaScript is one of the three core technologies used to build websites. You can also use it to build apps and browser games and connect servers to websites and web apps.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When using JavaScript in coding, web developers can implement the following features on web pages:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display timely content updates<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display interactive maps<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Insert hamburger-style and drop-down menus\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Play audio, video, and animation<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Zoom in and out of images<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display image galleries in a carousel format<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Insert hover effects<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display and hide menus\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Alert users to invalid characters when typing passwords<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Render other dynamic and interactive elements<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">What Are the Advantages of JavaScript?<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">JavaScript (JS) offers web developers and end-users many advantages. First, JS is renowned for its speed. Since it\u2019s an interpreted language, it reduces the time needed for compilation. Connecting to the server is faster, and the program can execute.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Second, JS is easy to learn and interpret, thanks to its clean and straightforward syntax. Third, it\u2019s ubiquitous. All modern browsers support JS, the majority of programmers use it, and many of the most widely-used apps and websites are on JS.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Fourth, JS is very versatile, and the language works well with other programming languages. Fifth, the language offers rich interfaces, allowing developers to create eye-catching websites with numerous interactive elements.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Websites, games, and apps built with JavaScript are more functional, useful, and interactive<\/span><span style=\"font-weight: 400;\">\u2014<\/span><span style=\"font-weight: 400;\">and this benefits end-users immensely.\u00a0<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">What Is a Script Tag?<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">&lt;script&gt; <\/span><span style=\"font-weight: 400;\">tag is used to embed a JavaScript or client-side script directly into the HTML document. You can also add it through external script files. <\/span><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">&lt;script&gt; <\/span><span style=\"font-weight: 400;\">tag either contains scripting statements or points to an external file via the <\/span><span style=\"font-weight: 400;\">src<\/span><span style=\"font-weight: 400;\"> (source) attribute.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When inserted inline, the <\/span><span style=\"font-weight: 400;\">&lt;script&gt; <\/span><span style=\"font-weight: 400;\">tag can be placed either in the <\/span><span style=\"font-weight: 400;\">&lt;head&gt;<\/span><span style=\"font-weight: 400;\"> section of your HTML or in the <\/span><span style=\"font-weight: 400;\">&lt;body&gt;<\/span><span style=\"font-weight: 400;\"> section. The placement would depend on when you want the JavaScript code to load.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1489,"featured_media":11432,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"ppma_author":[2102],"class_list":["post-11428","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-posts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Add JavaScript to HTML In 2 Easy Steps - Coding Dojo<\/title>\n<meta name=\"description\" content=\"Learn how to add JavaScript to HTML two different ways in this easy step-by-step guide. Plus, get tips on adding JavaScript to HTML.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add JavaScript to HTML In 2 Easy Steps - Coding Dojo\" \/>\n<meta property=\"og:description\" content=\"Learn how to add JavaScript to HTML two different ways in this easy step-by-step guide. Plus, get tips on adding JavaScript to HTML.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\" \/>\n<meta property=\"og:site_name\" content=\"Coding Dojo\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CodingDojodotco\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-22T14:00:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"533\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Brad Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodingDojoDotCo\" \/>\n<meta name=\"twitter:site\" content=\"@CodingDojoDotCo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\"},\"author\":{\"name\":\"Brad Mitchell\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792\"},\"headline\":\"How to Add JavaScript to HTML In 2 Easy Steps\",\"datePublished\":\"2022-06-22T14:00:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\"},\"wordCount\":2016,\"publisher\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg\",\"articleSection\":[\"All Posts\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\",\"name\":\"How to Add JavaScript to HTML In 2 Easy Steps - Coding Dojo\",\"isPartOf\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg\",\"datePublished\":\"2022-06-22T14:00:59+00:00\",\"description\":\"Learn how to add JavaScript to HTML two different ways in this easy step-by-step guide. Plus, get tips on adding JavaScript to HTML.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg\",\"contentUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg\",\"width\":800,\"height\":533,\"caption\":\"HTML on a laptop screen\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#website\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/\",\"name\":\"Coding Dojo\",\"description\":\"Coding Bootcamp News, Career Guidance and More\",\"publisher\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codingdojo.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#organization\",\"name\":\"Coding Dojo\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png\",\"contentUrl\":\"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png\",\"width\":287,\"height\":51,\"caption\":\"Coding Dojo\"},\"image\":{\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/CodingDojodotco\",\"https:\/\/x.com\/CodingDojoDotCo\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792\",\"name\":\"Brad Mitchell\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/image\/ec2fbcd1523bbd2627b9829b755f9a82\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g\",\"caption\":\"Brad Mitchell\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Add JavaScript to HTML In 2 Easy Steps - Coding Dojo","description":"Learn how to add JavaScript to HTML two different ways in this easy step-by-step guide. Plus, get tips on adding JavaScript to HTML.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html","og_locale":"en_US","og_type":"article","og_title":"How to Add JavaScript to HTML In 2 Easy Steps - Coding Dojo","og_description":"Learn how to add JavaScript to HTML two different ways in this easy step-by-step guide. Plus, get tips on adding JavaScript to HTML.","og_url":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html","og_site_name":"Coding Dojo","article_publisher":"https:\/\/www.facebook.com\/CodingDojodotco","article_published_time":"2022-06-22T14:00:59+00:00","og_image":[{"width":800,"height":533,"url":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg","type":"image\/jpeg"}],"author":"Brad Mitchell","twitter_card":"summary_large_image","twitter_creator":"@CodingDojoDotCo","twitter_site":"@CodingDojoDotCo","twitter_misc":{"Written by":"Brad Mitchell","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#article","isPartOf":{"@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html"},"author":{"name":"Brad Mitchell","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792"},"headline":"How to Add JavaScript to HTML In 2 Easy Steps","datePublished":"2022-06-22T14:00:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html"},"wordCount":2016,"publisher":{"@id":"https:\/\/www.codingdojo.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage"},"thumbnailUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg","articleSection":["All Posts"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html","url":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html","name":"How to Add JavaScript to HTML In 2 Easy Steps - Coding Dojo","isPartOf":{"@id":"https:\/\/www.codingdojo.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage"},"image":{"@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage"},"thumbnailUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg","datePublished":"2022-06-22T14:00:59+00:00","description":"Learn how to add JavaScript to HTML two different ways in this easy step-by-step guide. Plus, get tips on adding JavaScript to HTML.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codingdojo.com\/blog\/how-to-add-javascript-to-html#primaryimage","url":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg","contentUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/html-1.jpg","width":800,"height":533,"caption":"HTML on a laptop screen"},{"@type":"WebSite","@id":"https:\/\/www.codingdojo.com\/blog\/#website","url":"https:\/\/www.codingdojo.com\/blog\/","name":"Coding Dojo","description":"Coding Bootcamp News, Career Guidance and More","publisher":{"@id":"https:\/\/www.codingdojo.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codingdojo.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codingdojo.com\/blog\/#organization","name":"Coding Dojo","url":"https:\/\/www.codingdojo.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png","contentUrl":"https:\/\/www.codingdojo.com\/blog\/wp-content\/uploads\/Dojo-logo.png","width":287,"height":51,"caption":"Coding Dojo"},"image":{"@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CodingDojodotco","https:\/\/x.com\/CodingDojoDotCo"]},{"@type":"Person","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/f0763260736567f77d8107c616816792","name":"Brad Mitchell","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codingdojo.com\/blog\/#\/schema\/person\/image\/ec2fbcd1523bbd2627b9829b755f9a82","url":"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dcc8629d03d0958c0b46f7b63ec616978cba85abe345283ecd4ae3dee76e5146?s=96&r=g","caption":"Brad Mitchell"}}]}},"authors":[{"term_id":2102,"user_id":0,"is_guest":1,"slug":"bmitchell","display_name":"Brad Mitchell","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/72312b63980f6ac86a1d74e7a54f5de0d489ca9346796f60b8ea6810d65c89af?s=96&r=g","author_category":"","user_url":"","last_name":"Mitchell","first_name":"Brad","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts\/11428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/users\/1489"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/comments?post=11428"}],"version-history":[{"count":0,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/posts\/11428\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/media\/11432"}],"wp:attachment":[{"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/media?parent=11428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/categories?post=11428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/tags?post=11428"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.codingdojo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=11428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}