<html lang="ko">
<head>
<meta charset="UTF-8">
<title>jQuery Utility Method</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
$(function() {
$("button").on("click", function() {
$("#text")
.append($.type(true) + "<br>") // boolean
.append($.type(new Boolean()) + "<br>") // boolean
.append($.type(100) + "<br>") // number
.append($.type(new Number(20)) + "<br>") // number
.append($.type("문자열") + "<br>") // string
.append($.type(new String("홍길동")) + "<br>") // string
.append($.type(function() {}) + "<br>") // function
.append($.type(new Function()) + "<br>") // function
.append($.type([]) + "<br>") // array
.append($.type(/정규표현식/) + "<br>") // regexp
.append($.type(null) + "<br>"); // null
});
});
</script>
</head>
<body>
<h1>$.type() 메소드</h1>
<button>타입 검사!</button>
<p id="text"></p>
</body>
</html>