i'm a beginner at javascript. How do i select in javascript the first option in html "<option value="">Choose an image...</option>
"? *without changing the html?
My guess is this: memeForm.getElementById('meme-image').getElementByName('option')
??
I want to select this so that if the user picks this one (which is the default) they get an error message. Thanks in advance.
window.addEventListener('load', function(e){
const memeForm = document.querySelector('.meme-form');
memeForm.addEventListener('submit', function(e){
e.preventDefault();
if()
});
})
<form class="meme-form">
<div class="form-control">
<label for="meme-image">Meme Image</label>
<select name="memeImage" id="meme-image">
<option value="">Choose an image...</option>
<option value="cat-meme">Cat Meme</option>
<option value="dog-meme">Dog Meme</option>
<option value="man-meme">Man Man</option>
</select>