"JQuery .toArray()"의 두 판 사이의 차이

(새 문서: ==개요== ;jQuery .toArray(); <source lang='html5'> <script src="//code.jquery.com/jquery.min.js"></script> <script> $(function() { console.log( $( "li" ).toArray() ); // [li, li,...)
 
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 8개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;jQuery .toArray();
;jQuery .toArray();
*jQuery 집합에 포함된 모든 요소를 배열로 인출


<source lang='html5'>
<syntaxhighlight lang='html5'>
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="//code.jquery.com/jquery.min.js"></script>
<script>
<script>
$(function() {
$(function() {
alert( $( "li" ).toArray() );
// [object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement]
console.log( $( "li" ).toArray() );
console.log( $( "li" ).toArray() );
// [li, li, li]
// [li, li, li]
16번째 줄: 19번째 줄:
<li>석삼</li>
<li>석삼</li>
</ul>
</ul>
</source>
</syntaxhighlight>
*예제: http://zetawiki.com/ex/jquery/toarray.html


==참고 자료==
==같이 보기==
*[[jQuery .get()]]
*[[jQuery .index()]]
*[[jQuery .size()]]
 
==참고==
*https://api.jquery.com/toArray/
*https://api.jquery.com/toArray/


[[분류: jQuery]]
[[분류: jQuery]]
[[분류: 배열]]

2020년 11월 2일 (월) 02:53 기준 최신판

1 개요[ | ]

jQuery .toArray();
  • jQuery 집합에 포함된 모든 요소를 배열로 인출
<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$(function() {
	alert( $( "li" ).toArray() );
	// [object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement]
	console.log( $( "li" ).toArray() );
	// [li, li, li]
});
</script>

<ul>
<li>한놈</li>
<li>두시기</li>
<li>석삼</li>
</ul>

2 같이 보기[ | ]

3 참고[ | ]

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