JavaScript: what it is, and how it can be included in a page
The JavaScript programming language was invented specifically for the purpose of creating interactive websites.
We call JavaScript code a script. It is saved in a separate file with the extension js, and in order to launch it, the file must be included on a page. HTML has a special tag for adding JavaScript:
<script src="file_address"></script>
The script is usually included at the very end of the page, before the closing tag </body>.
A JavaScript program is a sequence of instructions that tell the browser to take certain actions. Instructions are executed sequentially, from top to bottom.
To tell JavaScript that the instruction is complete, you need to write a semicolon or make a line break. The line break works correctly in most cases, but the semicolon always works. Therefore, it is better to write a semicolon at the end of each instruction.
JavaScript does not change the source file with the markup, but rather it changes the page directly in the user’s browser in the process of following instructions.
Comments
A comment is text that provides an explanation of the code. It is not displayed in the browser and does not affect the operation of the program. Any instructions inside the comment are not executed, so comments are often used if you need to temporarily disable part of the code.
JavaScript has two kinds of comments:
// Single-line comments
/*
And multi-line comments.
These can deactivate several lines of code at once.
*/
QuerySelector method
To find an element on a page, you need to use the querySelector method. It searches by selector:
document.querySelector('selector');
This instruction consists of two parts. The first part is the element that JavaScript will search inside. The word
document indicates the web page where the script is included. It really doesn’t matter what the name of the file is. In JavaScript it is always a “document”. It is the parent element of any other element on the page.
The second part of the instruction is what needs to be done. It is called the method.
Console
The console is a developer tool that will help us to test our code. If an error occurs during the execution of the script, an error message will appear in the console. And you can also output text prompts to the console. To output a message to the console, you need to use the console.log:
console.log('Hello from JavaScript!');
// Displays: Hello from JavaScript!
console.log(document.querySelector('.page'));
// Displays the found element in the console
Variable
A variable is a way of storing data by giving it an understandable name.
You can create a variable or declare one using the keyword let. It is followed by the name of the variable. After the declaration, we need to add or assign some value to the variable:
let header = document.querySelector('header');
The variable name can be almost anything, but it should not start with a number, and '_' and '$' are the only allowed special characters.
In addition, JavaScript has reserved words that cannot be used to name variables. Variable names are case sensitive: header, Header and HEADER are different variables. The variable name should describe what is stored in it.
When a variable occurs in the code, the browser substitutes the value assigned to it instead of its name. When we use the variable, there is no need to write let again:
console.log(header);
The keyword let appeared in JavaScript in 2015. Before that, the word var was used to declare variables.
Methods for changing classes
To remove a class from an element, use the classList.remove method. It removes the class that is indicated in parentheses from the element:
element.classList.remove('class');
To add a class to an element, you need to use the classList.add method:
element.classList.add('class');
The classList.toggle switcher removes the specified class from the element, if any exists, and adds it if this class does not exist:
element.classList.toggle('class');
The textContent property
Each element has many properties, including size, color, and so on. The textContent property is used to contain the textual content of the element. Properties can be assigned new values:
let paragraph = document.querySelector('p');
paragraph.textContent = 'Muffin was here. Meow!';
Property value
Input fields have a special property — value. It stores the data that was entered in the field. We can display them directly on the page:
let input = document.querySelector('input');
paragraph.textContent = input.value;
Concatenation
The operation when we “glue” several values together is called concatenation, and in JavaScript it is executed using the plus sign.
let name = 'Muffin';
paragraph.textContent = 'Your name is' + name + '. Good day!';
console.log(paragraph.textContent);
// Displays: Your name is Muffin. Good day!
Event handlers onclick and onsubmit
JavaScript can track everything that happens on the page. When a user clicks on a button or submits a form, this is an event. We can tell JavaScript what to do when an event occurs. Event handlers are used to do this. The instructions that will be executed when the event occurs are placed between curly braces.
The onclick property means “when clicked”:
let button = document.querySelector('button');
button.onclick = function() {
console.log('Button pressed!');
};
Each time you click on a button, a new message will appear in the console: Button pressed!.
The onsubmit property is responsible for processing the form submission:
let form = document.querySelector('form');
form.onsubmit = function() {
console.log('Form submitted!');
};
After the form is submitted, the message Form submitted! will be displayed in the console.
Continue
<!DOCTYPE html><html lang="en" class="no-js"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script>var b=document.documentElement.classList;b.remove('no-js');if(!window.Promise||!window.sessionStorage||!!sessionStorage.getItem('muller.v2')){b.add('muller')}</script><link rel="dns-prefetch" href="https://assets.htmlacademy.org"><script async src="https://www.googletagmanager.com/gtag/js?id=G-MXPCRXM48C"></script><script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MXPCRXM48C');
</script><script type="text/javascript">
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
;r.type="text/javascript"
;r.integrity="sha384-d/yhnowERvm+7eCU79T/bYjOiMmq4F11ElWYLmt0ktvYEVgqLDazh4+gW9CKMpYW"
;r.crossOrigin="anonymous";r.async=true
;r.src="https://cdn.amplitude.com/libs/amplitude-5.2.2-min.gz.js"
;r.onload=function(){if(!e.amplitude.runQueuedFunctions){
console.log("[Amplitude] Error: could not load SDK")}}
;var i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)
;function s(e,t){e.prototype[t]=function(){
this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this}}
var o=function(){this._q=[];return this}
;var a=["add","append","clearAll","prepend","set","setOnce","unset"]
;for(var u=0;u<a.length;u++){s(o,a[u])}n.Identify=o;var c=function(){this._q=[]
;return this}
;var l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"]
;for(var p=0;p<l.length;p++){s(c,l[p])}n.Revenue=c
;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"]
;function v(e){function t(t){e[t]=function(){
e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}
for(var n=0;n<d.length;n++){t(d[n])}}v(n);n.getInstance=function(e){
e=(!e||e.length===0?"$default_instance":e).toLowerCase()
;if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};v(n._iq[e])}return n._iq[e]}
;e.amplitude=n})(window,document);
amplitude.getInstance().init("df11525b6880a3c5e2af14f9b6238408", null,{
includeUtm: true,
includeGclid: true,
includeReferrer: true,
deviceIdFromUrlParam: true
}, function (instance) {
window.amplitudeLoaded = true;
});
</script><link rel="stylesheet" href="https://assets.htmlacademy.org/css/core.v284.css"><link rel="stylesheet" href="https://assets.htmlacademy.org/css/profile.v236.css"><link rel="stylesheet" href="https://assets.htmlacademy.org/css/course.v246.css"><link rel="stylesheet" href="https://assets.htmlacademy.org/css/course-interface-light.v20.css"><link rel="stylesheet" href="https://assets.htmlacademy.org/css/course-interface-en.v2.css"><script src="https://assets.htmlacademy.org/js/sentry.js" data-sentry="3774884cc81746ed84c0ba7c5cd4ac7b" data-project="26" data-version="2"></script><link rel="stylesheet" href="/css/custom.css"><link rel="stylesheet" href="/css/cookies.css"><link rel="preload" as="script" href="https://assets.htmlacademy.org/js/general.v274.js"><title>Summary of “Introduction to JavaScript” — Introduction to JavaScript — HTML Academy</title><meta name="csrf-token" content="32264caf322823086fca37a7326b9bd2a54"><meta property="og:type" content="website"><meta property="og:site_name" content="HTML Academy"><meta name="twitter:url" property="og:url" content="https://htmlacademy.org"><meta name="twitter:title" property="og:title" content="Interactive online courses HTML Academy"><meta name="twitter:description" property="og:description" content="Together we’ll learn how to work with real code, solve true-to-life problems, use cutting edge technologies. Minimum of boring theory and lots of practical tasks."><meta name="twitter:image" property="og:image" content="https://htmlacademy.org/og/htmlacademy.png"><meta name="twitter:card" content="summary_large_image"><link rel="canonical" href="https://htmlacademy.org/courses/intro-to-web-development/javascript/summary"><meta name="theme-color" content="#2f358f"></head><body class="course-interface course-interface--light course-interface--full" data-base="/assets/courses/18/"><header class="page-header page-header--course"><div class="page-header__inner"><div class="page-header__top"><a class="page-header__logo" href="/" aria-label="HTML Academy Home"><img src="https://assets.htmlacademy.org/img/logo--small.svg?cs=1218aec0be4a5f23db79ad29a14e30f7f9fb9a25" width="24" height="36" alt="HTML Academy"></a><nav class="main-nav main-nav--mini" role="navigation"><div class="main-nav__course-nav"><a class="main-nav__course-item main-nav__course-button main-nav__course-button--prev" href="/courses/intro-to-web-development/javascript/concatenation">Let’s use concatenation</a><div class="main-nav__course-item main-nav__course-list main-nav__course-list--collapsed"><b class="main-nav__course-title">Introduction to JavaScript</b><span class="main-nav__course-stat">17/17</span><div class="main-nav__course-contents"><a class="main-nav__course-contents-link" href="/courses/intro-to-web-development/javascript">Back to the list of tasks</a><ul class="main-nav__course-contents-list"><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/javascript">1. Why is JavaScript necessary?</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/theme-switcher">2. Introduction to the theme switcher</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/query-selector">3. Find an element using querySelector</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/output-element">4. Output the element to the console.</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/remove-class">5. Let’s remove the class using classList.remove</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/add-class">6. Let’s add a class to the element using classList.add</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/declare-variable">7. Declare a variable</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/event-handler">8. Introduction to the event handler</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/switch-theme">9. Let’s make it so that the theme is switched when the button is clicked</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/toggle-class">10. Introduction to classList.toggle</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/finish-theme-switcher">11. Let’s finish our theme switcher</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/text-content">12. Introduction to the textContent property</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/change-text-content">13. Change the textual content for the element</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/uncomment-code">14. Uncomment the code</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/input-value">15. We retrieve data from the input field using input.value</a></li><li class="main-nav__course-contents-item"><a href="/courses/intro-to-web-development/javascript/concatenation">16. Let’s use concatenation</a></li><li class="main-nav__course-contents-item main-nav__course-contents-item--current"><a href="/courses/intro-to-web-development/javascript/summary">17. Summary of “Introduction to JavaScript”</a></li></ul></div></div><a class="main-nav__course-item main-nav__course-button main-nav__course-button--next" href="/courses/intro-to-web-development/javascript">List of tasks</a></div><ul class="main-nav__list main-nav__list--user main-nav__list--user-guest"><li class="main-nav__item" itemprop="name"><a class="main-nav__link" href="/signup?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" title="Sign up" data-modal="open" data-value="register" itemprop="url"><span class="main-nav__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#user"></use></svg></span>Sign up</a></li><li class="main-nav__item main-nav__item--login" itemprop="name"><a class="main-nav__link" href="/login?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" title="Log in" data-modal="open" data-value="login" itemprop="url"><span class="main-nav__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#login"></use></svg></span>Log in</a></li></ul></nav></div></div></header><main class="course-container"><div class="course-theory"><div class="course-theory__inner"><section class="course-theory__content"><h1 class="course-theory__content-heading course-theory__content-heading--synopsis">Summary of “Introduction to JavaScript”</h1><div class="course-theory__content-text"><h2>JavaScript: what it is, and how it can be included in a page</h2><p>The JavaScript programming language was invented specifically for the purpose of creating interactive websites.</p><p>We call JavaScript code a script. It is saved in a separate file with the extension <code>js</code>, and in order to launch it, the file must be included on a page. HTML has a special tag for adding JavaScript:</p><pre><code><script src="file_address"></script></code></pre><p>The script is usually included at the very end of the page, before the closing tag <code></body></code>.
<p>A JavaScript program is a sequence of instructions that tell the browser to take certain actions. Instructions are executed sequentially, from top to bottom.</p><p>To tell JavaScript that the instruction is complete, you need to write a semicolon or make a line break. The line break works correctly in <i>most cases</i>, but the semicolon <b>always</b> works. Therefore, it is better to write a semicolon at the end of each instruction.</p><p>JavaScript does not change the source file with the markup, but rather it changes the page directly in the user’s browser in the process of following instructions.</p><h2>Comments</h2><p>A comment is text that provides an explanation of the code. It is not displayed in the browser and does not affect the operation of the program. Any instructions inside the comment are not executed, so comments are often used if you need to temporarily disable part of the code.</p><p>JavaScript has two kinds of comments:</p><pre><code>// Single-line comments
/*
And multi-line comments.
These can deactivate several lines of code at once.
*/</code></pre><h2>QuerySelector method</h2><p>To find an element on a page, you need to use the <code>querySelector</code> method. It searches by selector:</p><pre><code>document.querySelector('selector');</code></pre><p>This instruction consists of two parts. The first part is the element that JavaScript will search inside. The word
<code>document</code> indicates the web page where the script is included. It really doesn’t matter what the name of the file is. In JavaScript it is always a “document”. It is the parent element of any other element on the page.</p><p>The second part of the instruction is what needs to be done. It is called the method.</p><h2>Console</h2><p>The console is a developer tool that will help us to test our code. If an error occurs during the execution of the script, an error message will appear in the console. And you can also output text prompts to the console. To output a message to the console, you need to use the <code class="nowrap">console.log</code>:</p><pre><code>console.log('Hello from JavaScript!');
// Displays: Hello from JavaScript!
console.log(document.querySelector('.page'));
// Displays the found element in the console</code></pre><h2>Variable</h2><p>A variable is a way of storing data by giving it an understandable name.</p><p>You can create a variable or <o>declare</b> one using the keyword <code>let</code>. It is followed by the name of the variable. After the declaration, we need to add or <b>assign</b> some value to the variable:</p><pre><code>let header = document.querySelector('header');</code></pre><p>The variable name can be almost anything, but it should not start with a number, and '_' and '$' are the only allowed special characters.
In addition, JavaScript has <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords" target="_blank" rel="nofollow noopener">reserved words</a> that cannot be used to name variables. Variable names are case sensitive: <code>header</code>, <code>Header</code> and <code>HEADER</code> are different variables. The variable name should describe what is stored in it.</p><p>When a variable occurs in the code, the browser substitutes the value assigned to it instead of its name. When we use the variable, there is no need to write <code>let</code> again:</p><pre><code>console.log(<mark>header</mark>);</code></pre><p>The keyword <code>let</code> appeared in JavaScript in 2015. Before that, the word <code>var</code> was used to declare variables.</p><h2>Methods for changing classes</h2><p>To remove a class from an element, use the <code class="nowrap">classList.remove</code> method. It removes the class that is indicated in parentheses from the element:</p><pre><code>element.classList.remove('class');</code></pre><p>To add a class to an element, you need to use the <code class="nowrap">classList.add</code> method:</p><pre><code>element.classList.add('class');</code></pre><p>The <code class="nowrap">classList.toggle</code> switcher removes the specified class from the element, if any exists, and adds it if this class does not exist:</p><pre><code>element.classList.toggle('class');</code></pre><h2>The textContent property</h2><p>Each element has many properties, including size, color, and so on. The <code>textContent</code> property is used to contain the textual content of the element. Properties can be assigned new values:</p><pre><code>let paragraph = document.querySelector('p');
<mark>paragraph.textContent</mark> = 'Muffin was here. Meow!';</code></pre><h2>Property value</h2><p>Input fields have a special property — <code>value</code>. It stores the data that was entered in the field. We can display them directly on the page:</p><pre><code>let input = document.querySelector('input');
paragraph.textContent = <mark>input.value</mark>;</code></pre><h2>Concatenation</h2><p>The operation when we “glue” several values together is called <b>concatenation</b>, and in JavaScript it is executed using the plus sign.</p><pre><code>let name = 'Muffin';
paragraph.textContent = 'Your name is' <mark>+</mark> name <mark>+</mark> '. Good day!';
console.log(paragraph.textContent);
// Displays: Your name is Muffin. Good day!</code></pre><h2>Event handlers onclick and onsubmit</h2><p>JavaScript can track everything that happens on the page. When a user clicks on a button or submits a form, this is an <i>event</i>. We can tell JavaScript what to do when an event occurs. Event handlers are used to do this. The instructions that will be executed when the event occurs are placed between curly braces.</p><p>The <code>onclick</code> property means “when clicked”:</p><pre><code>let button = document.querySelector('button');
button.onclick = function() {
console.log('Button pressed!');
};</code></pre><p>Each time you click on a button, a new message will appear in the console: <code>Button pressed!</code>.</p><p>The <code>onsubmit</code> property is responsible for processing the form submission:</p><pre><code>let form = document.querySelector('form');
form.onsubmit = function() {
console.log('Form submitted!');
};</code></pre><p>After the form is submitted, the message <code>Form submitted!</code> will be displayed in the console.</p><br><a class="button button--green button--large button--wide button--icon" href="/courses/intro-to-web-development/javascript"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#icon-check-bold"></use></svg>
Continue
</a></div></section></div></div><script
src="https://assets.htmlacademy.org/scripts/courses-spa/htmlacademy-task.v43.js"
data-assets-path="https://assets.htmlacademy.org/scripts/courses-spa/"
data-task-type="theory"
data-lang="en"
></script><script>HtmlacademyTask.setup(function(){});</script></main><footer class="page-footer page-footer--tiny"><div class="page-footer__inner"><p><a href="/docs/cookies">Cookies</a> ∙
<a href="/docs/privacy">Privacy</a> ∙
<a href="/docs/agreement">License Agreement</a> ∙
<a href="/docs/about">About</a> ∙
<a href="/contacts">Contacts</a> ∙
© HTML Academy OÜ, 2019−2026
</p><div class="page-footer__financial"><img src="https://assets.htmlacademy.org/img/visa-white.svg?cs=96e54ec8c587db9d4b1d8d328ffd87c2ebfd9555" alt="VISA" title="VISA" width="35" height="35"><img src="https://assets.htmlacademy.org/img/mastercard-horizontal.v2.svg" alt="Mastercard" title="Mastercard" width="35" height="35"></div></div></footer><div class="modal"><div class="modal__inner"><div class="modal__wrapper js-login hidden"><button class="modal__close icon-close" type="button" title="Close" data-modal="close"></button><h4 class="modal__header">Log in</h4><ul class="modal__social"><li class="modal__social-link modal__social-link--fb"><a href="/login/fb?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" rel="nofollow" title="Log in via Facebook"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#facebook"></use></svg></a></li><li class="modal__social-link modal__social-link--google"><a href="/login/google?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" rel="nofollow" title="Log in via Google"><svg height="30" width="30" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M457.732 216.625c2.628 14.041 4.063 28.743 4.063 44.098C461.796 380.688 381.481 466 260.204 466c-116.023 0-210-93.977-210-210s93.977-210 210-210c56.704 0 104.077 20.867 140.44 54.73l-59.204 59.197v-.135c-22.046-21.002-50-31.762-81.236-31.762-69.297 0-125.604 58.537-125.604 127.841 0 69.29 56.306 127.968 125.604 127.968 62.87 0 105.653-35.965 114.46-85.312h-114.46v-81.902h197.528z"/></svg></a></li></ul><div class="modal__or"><span>or</span></div><form class="modal__form form" action="/login?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" autocomplete="off" method="post" data-submit="o"><input type="hidden" name="csrf_name" value="csrf69aed42c8656d"><input type="hidden" name="csrf_value" value="e003607e2dd4d51db2e26beae805e4b1"><div class="form__group"><label class="sr-only" for="login-email">Email</label><input class="field field--text field--full-width" type="email" name="email" placeholder="Email" value="" id="login-email"></div><div class="form__group"><label class="sr-only" for="login-password">Password</label><input class="field field--text field--full-width ym-disable-keys" type="password" name="password" placeholder="Password" id="login-password"></div><input class="button button--full-width" type="submit" data-submit-text="Logging in…" value="Log in"></form><p class="modal__forgot-password"><a href="/recover" data-modal="open" data-value="recover">Forgot your password?</a></p><a class="modal__bottom-link" href="/signup" data-modal="open" data-value="register">Sign up</a></div><div class="modal__wrapper js-register hidden"><button class="modal__close icon-close" type="button" title="Close" data-modal="close"></button><h4 class="modal__header">Sign up</h4><ul class="modal__social"><li class="modal__social-link modal__social-link--fb"><a href="/login/fb?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" rel="nofollow" title="Log in via Facebook"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#facebook"></use></svg></a></li><li class="modal__social-link modal__social-link--google"><a href="/login/google?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" rel="nofollow" title="Log in via Google"><svg height="30" width="30" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M457.732 216.625c2.628 14.041 4.063 28.743 4.063 44.098C461.796 380.688 381.481 466 260.204 466c-116.023 0-210-93.977-210-210s93.977-210 210-210c56.704 0 104.077 20.867 140.44 54.73l-59.204 59.197v-.135c-22.046-21.002-50-31.762-81.236-31.762-69.297 0-125.604 58.537-125.604 127.841 0 69.29 56.306 127.968 125.604 127.968 62.87 0 105.653-35.965 114.46-85.312h-114.46v-81.902h197.528z"/></svg></a></li></ul><div class="modal__or"><span>or</span></div><form class="modal__form form" action="/signup?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" autocomplete="off" method="post"><input type="hidden" name="csrf_name" value="csrf69aed42c8656d"><input type="hidden" name="csrf_value" value="e003607e2dd4d51db2e26beae805e4b1"><div class="form__group"><label class="sr-only" for="email">
Email
<span class="required"><span class="sr-only">Required field</span><span class="required__star">*</span></span></label><div class="form__group-fields"><input class="field field--text field--full-width" type="email" name="email" value="" id="email" required placeholder="Email"></div></div><div class="form__group"><label class="sr-only" for="password">
Password
<span class="required"><span class="sr-only">Required field</span><span class="required__star">*</span></span></label><div class="form__group-fields"><input class="field field--text field--full-width" type="password" name="password" value="" id="password" required placeholder="Password"></div></div><div class="form__group"><label class="checkbox"><input class="checkbox__input" type="checkbox" name="agreement" value="1" required><span class="checkbox__text"><span>By signing up, you agree to our <a href="/docs/agreement" target="_blank">License Agreement</a> and <a href="/docs/privacy" target="_blank">Privacy Policy</a>.</span></span></label></div><input class="button button--full-width" type="submit" data-submit-text="Signing up…" value="Sign up"></form><a class="modal__bottom-link" href="/login?redirect_url=%2Fcourses%2Fintro-to-web-development%2Fjavascript%2Fsummary" data-modal="open" data-value="login">Log in</a></div><div class="modal__wrapper modal__wrapper--no-btn-bottom js-recover hidden"><button class="modal__close icon-close" type="button" title="Close" data-modal="close"></button><h4 class="modal__header">Restore access</h4><p class="modal__text-accent">Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.</p><form class="modal__form form" action="/recover" autocomplete="off" method="post" data-submit="o"><input type="hidden" name="csrf_name" value="csrf69aed42c8656d"><input type="hidden" name="csrf_value" value="e003607e2dd4d51db2e26beae805e4b1"><div class="form__group"><label class="sr-only" for="recovery-email">Email</label><input class="field field--text field--full-width" type="email" name="email" placeholder="Email" value="" id="recovery-email"></div><script src='https://www.google.com/recaptcha/api.js'></script><div class="form__group"><div class="g-recaptcha" data-sitekey="6LetCTEqAAAAANROWtPzfC7Rfg9iIRiRt2k2FPn7"></div></div><input class="button button--full-width" type="submit" data-submit-text="Sending…" value="Send"></form><p class="modal__text">Forgot to connect your email to the profile? Email us and we’ll help.</p></div></div></div><script async src="https://assets.htmlacademy.org/js/general.v274.js" data-assets="https://assets.htmlacademy.org" data-require="toggle,navigation-courses,modal,form,nav"></script></body></html>