jQuery 사용 .type 삽입 된 값의 형식을 가져 오려고합니다. 내가 입력하면 예를 들어
는 A 텍스트 상자에 다음삽입 된 값 형식을 얻는 방법
02/10/2012
다음의 유형이date
my test
는 그 유형은string
123
다음의 유형number
이있다 내 코드이지만 예상 결과가 나오지 않습니다. string
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery.type demo</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
Type <b></b>
<script>
$(document).ready(function(){
$('#input').on('blur',function(){
var text = $('input').val();
if(text!==null) {
alert(text);
var t = jQuery.type(text);
alert(t);
}
else {
alert('get');
}
});
});
</script>
<input type='text' id='input'/>
</body>
</html>
음 ... 결과는 무엇입니까? –
@Kolink'string' –
모든 입력 값은 문자열입니다. – mplungjan