I created an array that randomly selects a movie, and below I have movie posters. When I click on a poster, it takes me to the movie on Netflix. It would be really helpful if the background color of the selected movie poster changed to green for easier identification.
javascript
function GetMovie()
{
var movies = new Array("13 assassins"); // just an example
var randomMovie = movies[Math.floor(Math.random() * movies.length)];
document.randform.randomfield.value = randomMovie;
}
</script>
html
<body>
<Div id=maincontent>
<section id="topcontent">
<form name="randform">
<input type="button" id="btnSearch" value="Click for a random movie" onclick="GetMovie();" />
<input type="text" name="randomfield" value="" size="50">
</form>
<section id="movies">
<!--13 assassins -->
<div id="movie">
<a href="link to film">
<img src="images/13.jpg" alt="player" width="225" height="325">
</a>
</div>
css
#movie{
margin-top:5%;
width:225px;
height:325px;
float:left;
background-color:whitesmoke; //want this to be green when the movie is picked
border-radius:5px;
margin-left:2%;
padding:2% 3%;
margin-bottom:2%;
margin-right:2%;
}