hey guys i have created a drop down menu for colors were when the user select their favorite color and click on go it will display a message, for example if the user selects red and then selects blue and clicks on go it should display an alert "Just like the sky!" but it is not working please i need help
This is the code for the javascript
<script type="text/javascript">
$('.go-btn').click(function analyzeColor3(myColor) {
if (myColor == "Blue" && "Red") {
alert("Just like the sky!");
}
else if (myColor == "Green" && "Black") {
alert("Just like shiraz!");
}
else {
alert("Suit yourself then...");
}
});
This is the HTML code
<h3>Favorite Color</h3>
<select>
<option name="fav_color3" value="Blue"> Blue <br /></option>
<option name="fav_color3" value="Green"> Green <br /></option>
</select>
<h3>Favorite Color</h3>
<select>
<option name="fav_color3" value="Black"> Black <br /></option>
<option name="fav_color3" value="Red"> Red <br /></option>
</select>
<button class="go-btn" onclick="analyzeColor3(this.value);" >
go</button>