I want to make a replacement for the <select>-tag.
For this im using the code below:
The menu works, with the exception of one thing. The final result should be:
Test [ ][]
with "[ ][]" as the menu.
However, the menu is positioned a line below Test:
Test
[ ][]
which is logical, because DIV is a block-element. However, I tried to use inline, inline-block, -moz-inline-box etc. but didnt manage to get it right. setSelected(this) replaces the text
Anyone a idea?
Koos
P.S. The JS-function showObject(elementId) toggles the visibility of an element; setSelected replaces the innerHTML of the div with id=as_SelectedItem with the innerHTML of the selected option.
For this im using the code below:
Code:
Test <div class="select">
<div class="selectedItem" id="as_SelectedItem">option 1</div>
<div class="pulldownButton" onClick="showObject('n1');">pulldownbutton</div>
<div id="n1" style="display: none;">
<div class="option" onclick="setSelected(this)">option 1</div>
<div class="option" onclick="setSelected(this)">option 2</div>
</div>
</div>
The menu works, with the exception of one thing. The final result should be:
Test [ ][]
with "[ ][]" as the menu.
However, the menu is positioned a line below Test:
Test
[ ][]
which is logical, because DIV is a block-element. However, I tried to use inline, inline-block, -moz-inline-box etc. but didnt manage to get it right. setSelected(this) replaces the text
Anyone a idea?
Koos
P.S. The JS-function showObject(elementId) toggles the visibility of an element; setSelected replaces the innerHTML of the div with id=as_SelectedItem with the innerHTML of the selected option.