scrimba
Frontend Career Path
Essential JavaScript concepts
Cookie Consent
Add modal message
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Add modal message
Expand for more info
index.js
run
preview
console
const modal = document.getElementById('modal')
const modalCloseBtn = document.getElementById('modal-close-btn')
const consentForm = document.getElementById('consent-form')

setTimeout(function(){
modal.style.display = 'inline'
}, 1500)

modalCloseBtn.addEventListener('click', function(){
modal.style.display = 'none'
})

consentForm.addEventListener('submit', function(e){
e.preventDefault()
/*
Challenge:
1. Take control of the "modal-text" element.
2. Make it so that when a user clicks on
the accept button, the HTML string below
is inserted into the modal-text div.

<div class="modal-inner-loading">
<img src="images/loading.svg" class="loading">
<p id="uploadText">
Uploading your data to the dark web...
</p>
</div>
*/
})


Console
/index.html
-2:29