How to make a text element box with options

93 3

That's what you do, and you don't know what the problem description is:
I need to create a text element similar to the select element.

<input readonly id="text1" name="text1" value=""/>

When you click text1, when you're playing an option page below, then the option page disappears, and text1 gets the value of the selected item.

What's the idea of this experience.

3 Answers

110 5
/* fakecode */
var trigger = document.getElementbyId('text1'),
 toggleFn = function(){
 target.style.display = (target.style.display == '') 'none': '';
 };
trigger.click = function(){
 toggleFn();
}
//setVal
if (target.selected) {
 trigger.value = target.value;
 toggleFn();
}
67 0

http://jiangzhengjun. Iteye. com/blog/4..
This should meet your needs.

...