Skip to content

Instantly share code, notes, and snippets.

@imaz
Created July 20, 2011 01:45
Show Gist options
  • Save imaz/1094167 to your computer and use it in GitHub Desktop.
Save imaz/1094167 to your computer and use it in GitHub Desktop.
pomotimer作る時にinnerHTMLを練習したもの
<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