Having trouble with this and I need to complete this in HTML Having trouble with
ID: 3759884 • Letter: H
Question
Having trouble with this and I need to complete this in HTML
Having trouble with these step.
3. In your script, retrieve the value that the user selected from the select box, and store that value (i.e. the 'frog' or the ‘chef’) in a variable.
4. If they selected Kermit, output “It’s not easy being green”. If they selected Swedish Chef output Bork bork bork! (Incidentally, if you'd like to choose other stars or really anything else, be my guest… Just be sure and demonstrate that you recognize that there is a difference in the text between the 'option' tags, and the value containsed inside the 'option' tags).
5. You must use a single 'if/else' for this. That is, do not use two separate 'if' blocks.
6. Demonstrate use of an external stylesheet in this document. You do not have to have any elaborate styling in this page, but apply at least one or two simple styles just so that you can demonstrate use of an external stylesheet.
This is my code -
<!DOCTYPE html> <html> <head> </head> <body> <form> <input type="text" placeholder="Pick a perferred movie" id="movie"> <input list="Movie" name="Movie"> <datalist id="Movie"> <option value="Kermit the Frog"> <option value="Swedish Chef"> </datalist><button>Choose Movie</button> Pick a preferred movie star from the following two options: <input list="MovieStar" name="Star"> <datalist id="MovieStar"> <option value="frog"> <option value="chef"> </datalist> <input type="submit"> </form> </body> </html>
Explanation / Answer
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<input type="text" placeholder="Pick a perferred movie" id="movie">
<input list="Movie" name="Movie">
<datalist id="Movie">
<option value="Kermit the Frog">
<option value="Swedish Chef">
</datalist>
<button>Choose Movie</button>
Pick a preferred movie star from the following two options:
<input list="MovieStar" name="Star">
<datalist id="MovieStar">
<option value="frog">
option value="chef">
</datalist>
<input type="submit">
</form>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.