01.Input.htm |
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>Input 모든폼 요소 읽어오기</title>
<script src="../jQuery/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{ var
result = ""; // 폼 요소가 있는 만큼 반복하자. //
alert($(':input').size()); //13개 $(':input').each(function(index) { result += "태그명 : " + $(this).get(0).tagName //
this.tagName + ", type 속성명 : " + $(this).attr('type') + '\n'; }); alert(result);
});
</script> </head> <body>
<input type="button" value="Input Button" /> <br />
<input type="text" /> <br />
<input type="password" /> <br />
<input type="checkbox" /> <br />
<input type="file" /> <br />
<input type="hidden" /> <br />
<input type="image" /> <br />
<input type="radio" /> <br />
<input type="reset" /> <br />
<input type="submit" /> <br />
<select><option>드롭다운리스트</option></select><br />
<textarea cols="20" rows="3">멀티라인텍스트박스</textarea><br />
<button>버튼</button><br /> </body> </html> |
결과화면 |
[그림23-1] |
'jQuery | javascript | CSS' 카테고리의 다른 글
25.jQuery - IF문 ( 02.Selectors - 03.PasswordConfirm ) (0) | 2009.11.09 |
---|---|
24.jQuery - 속성값 복사 ( 02.Selectors - 02.Text ) (0) | 2009.11.09 |
22.jQuery - For문 ( 01.Core- 02.Indexer ) (2) | 2009.11.09 |
21.jQuery - Each() 메서드 ( 01.Core-01.Each ) (0) | 2009.11.09 |
-- 현재 까지의 jQuery 소스 -- (0) | 2009.11.09 |
Comments