Last active
November 17, 2016 02:36
-
-
Save tomoumi-n/860b6a3143de3d41dae7725421d001a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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