<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
alert("Value: " + $("#test").val());
});
});
</script>
</head>
<body>
<p>Name: <input type="text" id="test" value="Mickey Mouse"></p>
<button>Show Value</button>
</body>
</html>
$("button").click(function(){ -- button 태그를 클릭시
alert("Value: " + $("#test").val()); -- 아이디가 test인 벨류값을 리턴받아서 alert로 뛰워준다.
val() 을 하면 밸류값을 얻는거고
val("aaaa") 을 하면 셋팅하는거다
제이쿼리 ajax 데이터 가져오기 (0) | 2015.03.03 |
---|---|
제이쿼리 append 이용하기 (0) | 2015.03.02 |
Jquery 포커스를 얻을때 , 잃었을때 (0) | 2015.03.02 |
자바스크립트 onmouseover 를 Jquery 로 (0) | 2015.03.02 |
onclick 을 Jqeury로 바꾸기 (0) | 2015.03.02 |