Skip to content

Instantly share code, notes, and snippets.

@angusdev
Created January 25, 2023 02:09
Show Gist options
  • Save angusdev/3070cd8b6c5321588b59e6d6d5d36f33 to your computer and use it in GitHub Desktop.
Save angusdev/3070cd8b6c5321588b59e6d6d5d36f33 to your computer and use it in GitHub Desktop.
Select from dropdown
javascript:(function(){window._bak_md=document.onmousedown||function(){};document.onmousedown=function(e){e=e||window.event;t=e.target;if(t.tagName=='SELECT'){p=prompt('Find the text in drop down');if(p){for(i=0;i<t.options.length;i++)if(t.options[i].textContent.indexOf(p)===0){t.selectedIndex=i;break;}}document.onmousedown=window._bak_md;window._bak_md=null;e.preventDefault();e.stopPropagation();}};})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment