Skip to content

Instantly share code, notes, and snippets.

@tomoumi-n
Last active November 17, 2016 02:36
Show Gist options
  • Save tomoumi-n/860b6a3143de3d41dae7725421d001a4 to your computer and use it in GitHub Desktop.
Save tomoumi-n/860b6a3143de3d41dae7725421d001a4 to your computer and use it in GitHub Desktop.
<meta charset="utf-8">
<title>keydownのテスト</title>
<p id="label"></p>
<script>
document.onkeydown = function(e) {
var elem = document.getElementById("label");
if(elem.innerHTML == "") {
elem.innerHTML = "aaa";
} else {
elem.innerHTML = "";
}
return false;
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment