Created
July 20, 2011 01:45
-
-
Save imaz/1094167 to your computer and use it in GitHub Desktop.
pomotimer作る時にinnerHTMLを練習したもの
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
<html> | |
<head> | |
<title>js study innerHTML</title> | |
<script language="JavaScript"> | |
<!-- | |
function strWrite(str){ | |
document.getElementById("ID").innerHTML = str; | |
} | |
function strCount(){ | |
var cnt = document.getElementById("ID").innerHTML; | |
cnt++; | |
document.getElementById("ID").innerHTML = cnt; | |
} | |
--> | |
</script> | |
</head> | |
<body> | |
<span id="ID">0</span> | |
<br><br> | |
<input type="button" value="sato" onClick="strWrite('ドヤッ!')"> | |
<input type="button" value="koda" onClick="strWrite('王子')"> | |
<input type="button" value="ima" onClick="strWrite('z!')"> | |
<input type="button" value="reset" onClick="strWrite('0')"> | |
<input type="button" value="count" onClick="strCount('')"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment