Hopefully a simple question here. I have the following html code:
<select id="dropdown">
<option value="#00FFFF">Cyan</option>
<option value="#FF00FF">Magenta</option>
</select>
<textarea style="background-color:[dropdown's selected value]">Sample Text</textarea>
What I’d like is the textarea’s background color to dynamically change based on the dropdown’s selection. Is there a simple way to reference the dropdown’s value using CSS, or would JavaScript be the better route? HTML5 and CSS3 are definitely fair game here. Thanks!
here: DEMO
jquery much easier