Shaun wrote:
Quote:
Hi,
Is it possible to use JavaScript to change some text on a page according to
the value set in a select box. For example if the select box has value A
selected then the text further down that page displays hello, if the select
box is changed to B then the text changes to goodbye etc...
A previous poster suggested I should use the document.write() function but
how would I use this, how would it know what piece of text to update, and
how would I call it from the select box change? |
<form action="">
<select
onChange="document.getElementById('foo').innerHTML =this[this.selectedIndex].value">
<option selected>Pick One</option>
<option value="Hello">A</option>
<option value="Goodbye">B</option>
</select>
</form>
<p id="foo"></p>
Mick