brew install nvm
restart terminal
nvm install 14.15
nvm alias default 14.15
restart terminal
// Select the form | |
const form = document.querySelector('#search-movies'); | |
// Listen to the submit event | |
form.addEventListener('submit', (event) => { | |
// Prevent the default reload behavior of the form | |
event.preventDefault(); | |
// Retrieve the searched keyword | |
const keyword = document.querySelector('#keyword').value; | |
// Call the API with the keyword | |
fetch(`http://www.omdbapi.com/?s=${keyword}&apikey=adf1f2d7`) |
// Select the button | |
// const button = document.getElementById('btn'); | |
const button = document.querySelector('#btn'); | |
// Listen to click event | |
button.addEventListener('click', (event) => { | |
// Update the btn text - Callback | |
event.currentTarget.innerText = 'Please wait'; | |
}); |
brew install nvm
restart terminal
nvm install 14.15
nvm alias default 14.15
restart terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
restart terminal
nvm install 14.15
If NVM is not found see the last section of this gist
nvm alias default 14.15
movies: | |
- title: "Superman" | |
year: 1978 | |
director_slug: donner | |
synopsis: | | |
An alien orphan is sent from his dying planet to Earth, | |
where he grows up to become his adoptive home's first and greatest superhero. | |
- title: "Batman v Superman: Dawn of Justice" | |
year: 2016 | |
director_slug: snyder |