Skip to content

Instantly share code, notes, and snippets.

@iSWORD
Created October 30, 2012 13:30
Show Gist options
  • Save iSWORD/3980197 to your computer and use it in GitHub Desktop.
Save iSWORD/3980197 to your computer and use it in GitHub Desktop.
HTML+JS Cross-browser editable select tag
<select name="project" onchange="t=this;n=t.nextElementSibling;if(t.value=='new')if(confirm('Add new '+t.name+'?')){n.style.display='inline-block'; n.name=t.name; t.name=''; t.style.display='none'; n.focus()}">
<option value="new"><new project></option>
<option selected>Project1</option>
<option>Project2</option>
<option>Project3</option>
</select>
<input style="display:none">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment