Events are actions that users take on the page (button clicks or key presses).
Adding Event Handlers
button.addEventListener('click', function () {
// Instructions
});
In the example:
- A button is an element where we want to “listen” for an event.
- addEventListener() is a function that is used to add an event handler to the element.
- 'click' is the commonly accepted name for an event and the first parameter of the addEventListener function. You can review the list of names for all events here.
- The second parameter of addEventListener is the handler function. All of the instructions that are executed are written to it only when an event occurs.
Please note that we are passing the function. We are not calling it. If we call a function, the code from this function is executed immediately, and it will not be triggered again. But what we need is for the code to be executed asynchronously, meaning only at the time when the event occurs.
// This is the wrong way of adding a handler.
button.addEventListener('click', function () {
console.log('Button click');
}());
// The message is output to the console immediately.
// The following is the correct code.
button.addEventListener('click', function () {
console.log('Button click');
});
// The message is output when a click event is triggered.
In the example above, we pass a function that does not have its own name to the function handler. It is not written to a variable. We created it in the place where we passed it to. These functions that are created at the moment that they are passed and do not have a name are called anonymous functions.
The event Object
The event object is a parameter of the handler function. It is always passed by the browser to this function at the time the event occurs. This object contains many useful properties and methods.
In order to use the event, all that we need to do is specify this object using the parameter of the handler function and write instructions. JavaScript will do the rest. It has become a standard practice among some developers to refer to this parameter using its abbreviation (evt) in order to avoid any errors.
Default Actions
Certain page elements have default actions. For example, when you click on the submit button of a form, the data entered in this form will be sent to the server, and when you click on a link, the browser goes to that link.
The event object contains a method that cancels the action of the element by default: preventDefault().
link.addEventListener('click', function(evt) {
// We cancel the action by default.
evt.preventDefault();
// We add instructions for the click action.
console.log('A click occurred');
});
Keyboard Events
The “keystroke” event has a special name: 'keydown'. This event is triggered when the user presses any key. It is important to note that you can only listen for this event using elements that are in focus: input fields, buttons, and elements with the tabindex and document attributes. When you press the button, the focus should shift to the corresponding element.
If we want to catch the keypress for a particular key, we can refer to the keyCode property of the event object. The property contains the code of the pressed key. For example, Enter has the code 13, whereas ESC has the code 27. These numbers are universal and the same for any layout. You can find the code for any key here.
document.addEventListener('keydown', function(evt) {
// We check that the key code is 27
if (evt.keyCode === 27) {
// The code here is only executed when the user presses ESC
}
});
There are other properties besides keyCode for determining the pressed key. For example, key and code. They return the names of the keys, not their numbers. These properties are not yet supported in all browsers, but when they are implemented more widely, you should start using them instead of the keyCode in accordance with the modern JavaScript standard.
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 “Events in JavaScript”, part 1 — Getting to know events — HTML Academy</title><meta name="csrf-token" content="56564caf322823086fca37a7326b9bd2a54"><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/javascript-browser/events/summary-1"><meta name="theme-color" content="#2f358f"></head><body class="course-interface course-interface--light course-interface--full" data-base="/assets/courses/30/"><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/javascript-browser/events/one-click">With one click</a><div class="main-nav__course-item main-nav__course-list main-nav__course-list--collapsed"><b class="main-nav__course-title">Getting to know events</b><span class="main-nav__course-stat">10/25</span><div class="main-nav__course-contents"><a class="main-nav__course-contents-link" href="/courses/javascript-browser/events">Back to the list of tasks</a><ul class="main-nav__course-contents-list"><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/intro-events">1. Introduction to events</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/add-handler">2. How to add a handler</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/arrange-events">3. How events are arranged</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/default-actions">4. Default actions</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/events">5. Please pass the function</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/hide-popup">6. Hiding the popup</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/press-key">7. Pressing a key</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/choose-key">8. Choosing a key</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/one-click">9. With one click</a></li><li class="main-nav__course-contents-item main-nav__course-contents-item--current"><a href="/courses/javascript-browser/events/summary-1">10. Summary of “Events in JavaScript”, part 1</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/first-program">11. First program: “Don’t be shy”</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/photo-gallery">12. Welcome to our photo gallery</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/click-em-all">13. Click ’em all!</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/add-image">14. Adding an image</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/bug">15. A bug has crept into the system</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/scope">16. Scope</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/global-scope">17. Global scope</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/insideout-variables">18. Inside out variables</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/independent-variable">19. Becoming Independent</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/closure">20. Closures</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/school-prepare">21. Let’s prepare for school</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/fix-gallery">22. Fixing the gallery</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/heart-matter">23. Getting to the heart of the matter</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/summary-2">24. Summary of “Events in JavaScript”, part 2</a></li><li class="main-nav__course-contents-item"><a href="/courses/javascript-browser/events/second-program">25. The Second Program: “Señor Tomato”</a></li></ul></div></div><a class="main-nav__course-item main-nav__course-button main-nav__course-button--next" href="/courses/javascript-browser/events/first-program">First program: “Don’t be shy”</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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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 “Events in JavaScript”, part 1</h1><div class="course-theory__content-text"><p><b>Events</b> are actions that users take on the page (button clicks or key presses).</p><h3>Adding Event Handlers</h3><pre><code>button.<mark>addEventListener('click', function () {
// Instructions
})</mark>;
</code></pre><p>In the example:</p><ul><li>A <code>button</code> is an element where we want to “listen” for an event.</li><li><code>addEventListener()</code> is a function that is used to add an event handler to the element.</li><li><code>'click'</code> is the commonly accepted name for an event and the first parameter of the <code class="nowrap">addEventListener</code> function. You can review the list of names for all events <a href="https://developer.mozilla.org/en-US/docs/Web/Events" target="_blank" rel="noopener">here</a>.</li><li>The second parameter of <code class="nowrap">addEventListener</code> is the handler function. All of the instructions that are executed are written to it only <b>when an event occurs</b>.</li></ul><p>Please note that <b>we are passing the function. We are not calling it</b>. If we call a function, the code from this function is executed immediately, and it will not be triggered again. But what we need is for the code to be executed <b>asynchronously</b>, meaning only at the time when the event occurs.</p><pre><code>// This is the wrong way of adding a handler.
button.addEventListener('click', function () {
console.log('Button click');
}<mark>()</mark>);
// The message is output to the console immediately.
// The following is the correct code.
button.addEventListener('click', function () {
console.log('Button click');
});
// The message is output when a click event is triggered.
</code></pre><p>In the example above, we pass a function that does not have its own name to the function handler. It is not written to a variable. We created it in the place where we passed it to. These functions that are created at the moment that they are passed and do not have a name are called <i>anonymous functions</i>.</p><h3>The event Object</h3><p>The <code>event</code> object is a parameter of the handler function. It is always passed by the browser to this function at the time the event occurs. This object contains many useful properties and methods.</p><p>In order to use the <code>event</code>, all that we need to do is specify this object using the parameter of the handler function and write instructions. JavaScript will do the rest. It has become a standard practice among some developers to refer to this parameter using its abbreviation (<code>evt</code>) in order to avoid any errors.</p><h3>Default Actions</h3><p>Certain page elements have default actions. For example, when you click on the submit button of a form, the data entered in this form will be sent to the server, and when you click on a link, the browser goes to that link.</p><p>The <code>event</code> object contains a method that cancels the action of the element by default: <code>preventDefault()</code>.</p><pre><code>link.addEventListener('click', function(<mark>evt</mark>) {
// We cancel the action by default.
<mark>evt.preventDefault();</mark>
// We add instructions for the click action.
console.log('A click occurred');
});
</code></pre><h3>Keyboard Events</h3><p>The “keystroke” event has a special name: <code>'keydown'</code>. This event is triggered when the user presses <b>any key</b>. It is important to note that you can only listen for this event using elements that are in focus: input fields, buttons, and elements with the <code>tabindex</code> and <b>document</b> attributes. When you press the button, the focus should shift to the corresponding element.</p><p>If we want to catch the keypress for a particular key, we can refer to the <code>keyCode</code> property of the <code>event</code> object. The property contains the code of the pressed key. For example, <code>Enter</code> has the code <code>13</code>, whereas <code>ESC</code> has the code <code>27</code>. These numbers are universal and the same for any layout. You can find the code for any key <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode" target="_blank" rel="noopener">here</a>.</p><pre><code>document.addEventListener('keydown', function(<mark>evt</mark>) {
// We check that the key code is 27
if (<mark>evt.keyCode === 27</mark>) {
// The code here is only executed when the user presses ESC
}
});
</code></pre><p>There are other properties besides <code>keyCode</code> for determining the pressed key. For example, <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key" target="_blank" rel="noopener">key</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code" target="_blank" rel="noopener">code</a>. They return the names of the keys, not their numbers. These properties are not yet supported in all browsers, but when they are implemented more widely, you should start using them instead of the <code>keyCode</code> in accordance with the modern JavaScript standard.</p><br><a class="button button--green button--large button--wide button--icon" href="/courses/javascript-browser/events/first-program"><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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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%2Fjavascript-browser%2Fevents%2Fsummary-1" autocomplete="off" method="post" data-submit="o"><input type="hidden" name="csrf_name" value="csrf69aea79d84c39"><input type="hidden" name="csrf_value" value="e28e621963612ab9bd46902b687b5a2f"><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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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%2Fjavascript-browser%2Fevents%2Fsummary-1" autocomplete="off" method="post"><input type="hidden" name="csrf_name" value="csrf69aea79d84c39"><input type="hidden" name="csrf_value" value="e28e621963612ab9bd46902b687b5a2f"><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%2Fjavascript-browser%2Fevents%2Fsummary-1" 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="csrf69aea79d84c39"><input type="hidden" name="csrf_value" value="e28e621963612ab9bd46902b687b5a2f"><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>