Click Already Selected Option In Select Box
This seems like it should be easy, but the limitations of the
Solution 1:
This might help:
functiononFocus(element){
element.setAttribute('old-value',element.value);
element.value='';
console.log('reset');
}
functiononBlur(element){
if(element.value=='')
element.value = element.getAttribute('old-value');
element.removeAttribute('old-value');
}
functiononChange(element){
console.log('New Value : '+ element.value);
}
<selectid="mySelect"onfocus="onFocus(this)"onchange="onChange(this)"onblur="onBlur(this);"><optionvalue=""style="display:none;"></option><optionvalue="one">one</option><optionvalue="two">two</option><optionvalue="three">three</option></select>
Post a Comment for "Click Already Selected Option In Select Box"