Skip to content

Instantly share code, notes, and snippets.

@ronekko
Last active May 18, 2017 05:53
Show Gist options
  • Select an option

  • Save ronekko/27cf9a0076a007cabf13a04098768b1c to your computer and use it in GitHub Desktop.

Select an option

Save ronekko/27cf9a0076a007cabf13a04098768b1c to your computer and use it in GitHub Desktop.
スペースアルクで検索後にテキストボックスを空にする
// ==UserScript==
// @name ALC - Auto-clear Textbox
// @namespace http://profile.livedoor.com/ronekko/
// @description スペースアルクで検索後にテキストボックスを空にする
// @include http://eow.alc.co.jp/*
// @include https://eow.alc.co.jp/*
// @version 20170518
// ==/UserScript==
var textbox = document.getElementById('q');
var value = textbox.value;
textbox.value = '';
document.getElementById('searchWord').addEventListener('click', function(event){
textbox.value = value;
textbox.focus();
}, true);
document.addEventListener('keydown', function(e){
textbox.focus();
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment