Skip to content

Instantly share code, notes, and snippets.

@nekonenene
Created February 1, 2016 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekonenene/117256c8a319399a9251 to your computer and use it in GitHub Desktop.
Save nekonenene/117256c8a319399a9251 to your computer and use it in GitHub Desktop.
ブログ公開用:無駄の多いJSコード
window.addEventListener("load", function () {
var h1Tag = document.getElementsByTagName("h1") ;
h1Tag[0].style.color = "red" ;
var practiceStringOutEle = document.getElementById("practiceString") ;
stringLesson(practiceStringOutEle) ;
/* 文字列を入れてみる */
function stringLesson(ele){
var str1 = "Windows" ;
var str2 = "X" ;
var str3 = "professional" ;
var i = 1 ;
ele.innerHTML = "" ;
function outputAllStrings(){
ele.innerHTML += i + " : " + str1 + " " + str2 + " " + str3 + "<br>" ;
console.log(i) ;
++i ;
}
outputAllStrings() ; // 1
};
}, false);
(function(){});
// ↑ 無駄な改行などなど
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment