Created
February 1, 2016 18:21
-
-
Save nekonenene/117256c8a319399a9251 to your computer and use it in GitHub Desktop.
ブログ公開用:無駄の多いJSコード
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
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