Topics related to client-side programming language.
Post questions and answers about JavaScript, Ajax, or jQuery codes and scripts.
2 posts
• Page 1 of 1
Marius
Posts: 106
Display selected option into a Div
How can I make that when an option from dropdowna <select> list is selected, the value of that option be displayed into a Div.
I have this html code, with the list of options and the Div tag:
<select id='drink'>
<option value=''>Which drink would you like?</option>
<option>Latte</option>
<option>Capuccino</option>
<option>Americano</option>
<option>Tea</option>
</select>
<div id='output'></div>
MarPlo
You have to start with a <select> element which raises a 'change' event when an option is selected.
Inside that event, 'this.value' refers to the selected value.
NASA has chosen Nokia to build a 4G network on the moon as part of the space agency's Artemis programme, which aims to establish a sustainable human...
Sony has debuted a new kind of 3D monitor with its Spatial Reality Display, which tracks your eyes and shows a different dynamically-generated image...