Last active
February 15, 2016 04:41
-
-
Save crongro/72be60dffc3f297d5e40 to your computer and use it in GitHub Desktop.
debug_ex_1
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>1.html</title> | |
<style> | |
section{margin:50px}section ul{width:450px;margin:0 auto;overflow:hidden}section ul li{list-style:none;width:100px;height:100px;border:1px solid gray;line-height:100px;text-align:center;margin-right:5px;float:left}section ul li:nth-child(2){cursor:pointer}.log{width:100px;margin:0 auto}.log button{height:30px;width:100%;font-size:1em}.board{font-size:1.5em;font-weight:700;text-align:center;margin-top:10px} | |
</style> | |
</head> | |
<body> | |
<section> | |
<ul> | |
<li>1</li> | |
<li>나를눌러봐</li> | |
<li>3</li> | |
<li>4</li> | |
</ul> | |
</section> | |
<script> | |
var myObj = { | |
handlerPrintLog : function(evt) { | |
var str = "Hello, you did "; | |
console.log(str + evt.type); | |
} | |
} | |
var elSecondLI = document.querySelector("li:nth-child(2)"); | |
elSecondLI.addEventListener("click", myObj.handlerPrintLog, false); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment