"JQuery input name으로 선택"의 두 판 사이의 차이

(새 문서: {{소문자}} ==예제 소스== <source lang='html5'> <!DOCTYPE html> <meta charset='utf-8' /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></scrip...)
 
20번째 줄: 20번째 줄:
</source>
</source>
*예제: http://jmnote.com/jq/by_name.php
*예제: http://jmnote.com/jq/by_name.php
==같이 보기==
*[[jQuery 형식에 따라 폼 요소 선택]]


[[분류:jQuery]]
[[분류:jQuery]]

2012년 3월 26일 (월) 20:57 판

1 예제 소스

<!DOCTYPE html>
<meta charset='utf-8' />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#test").click(function() {
		alert($("input[name=jmnote]").attr("value"));
	});
});
</script>
<form name='my_form'>
<input type='text' name='jmnote' value='apple' />사과</label>
<input type='button' id='test' value='이름으로 찾기 테스트' />
<br/>
</form>

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}