scrimba
Frontend Career Path
Essential JavaScript concepts
Cookie Consent
Add modal messages 2
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 messages 2
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')
const modalText = document.getElementById('modal-text')

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

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

consentForm.addEventListener('submit', function(e){
e.preventDefault()
modalText.innerHTML = `
<div class="modal-inner-loading">
<img src="images/loading.svg" class="loading">
<p id="upload-text">Uploading your data to the dark web...</p>
</div>`

/*
Challenge:
1. Use a setTimeout to make the phrase "Uploading
your data to the dark web" change to "Making the
sale..." after 1.5 seconds.
⚠️ Do not change the loading svg!
*/

})
Console
/index.html
-5:30