1. jQuery 코어(위)
                                            
 5300 단어  jquery
                    
/**
 *          
 *
 * @param  expression         css      (       “   ”  )
 * @param  context          (    ),DOM    、    jQuery   
 *
 * @return	jQuery  
 */
jQuery(expression, [context])예:
$("p", $("table") 또는 $("p", document.getElementsByTagName ("table"): 모든 table 요소의 하위 요소 p를 찾습니다.
$("p",document.forms[0]: 첫 번째 form 폼에서 p 하위 요소를 찾습니다.
/**
 *      html      ,  DOM  
 *
 * @param  html	    DOM   html      
 * @param  ownerDocument    DOM       (    ,   ,             ,       document)
 *
 * @return	jQuery  
 */
jQuery(html, [ownerDocument])예:
$("
").appendTo("#aa"): input 요소를 만들고 id가 aa인 요소에 배치합니다.
/**
 *      DOM       ,       html      ,  DOM  ,              
 *           、     
 *
 * @param  html      DOM   html      
 * @param  props                、     
 *
 * @return	jQuery  
 */
jQuery(html, props)예:
$("",{
"class":"test",
type:"button",
value: "test 테스트",
click:function() {
alert("허허...");
}
}).appendTo("#aa"): button 형식의 input 요소를 만들고 속성과 이벤트 방법을 추가했습니다.
/**
 *     DOM     jQuery  (    jquery     DOM  )
 *
 * @param  elements       jQuery   DOM  ,              
 *
 * @return JQuery  
 */
jQuery(elements)예:
$($("p")).hide() 또는 $(document.getElementsByTagName('p').hide(): 페이지의 전체 p 요소를 숨깁니다.
$(document.all).hide(): 페이지의 모든 요소를 숨깁니다.
/**
 *       jQuery  (   ,             )
 *
 * @return  jQuery  
 */
jQuery();예: 생략
/**
 * $(document).ready()   ,     DOM            ,     body    onload  
 *      
 *
 * @param  callback   DOM            
 * 
 * @return  jQuery  
 */
jQuery(callback)예:
jQuery(function() {
alert("document ready.....");
}: 문서가 로드되면 document ready가 인쇄됩니다.
$(document).ready(function() {
alert("document ready.....");
}: 위와 같습니다.
2, 객체 액세스
/**
 *       (  )    
 *
 * @param  elements      ,           
 * @param  callback                ,            (function(i,els)),     (i)    
 * 		            , 0  ,         ,             this          
 *
 * @return  JQuery  
 */
each([elements], callback)예: 페이지의 모든 input 구성 반복
$("input").each(function(i, els) {
alert(i+","+els.value);
});
또는
$("input").each(function(i) {
alert(i+","+this.value);
});
또는
var inpus = document.getElementsByTagName('input');
$.each(inpus, function(i, els){
alert(i+","+els.value);
});
/**
 * jQuery   (    )      
 *
 * @return      (     )Number
 */
size()예: 인쇄 페이지의 모든 input 요소 개수
alert($("input").size());
/**
 *       , size(),    size()     , length     
 *
 * @return     Number
 */
length예: 인쇄 페이지의 모든 input 요소 개수
alert($("input").length);
/**
 *       ,     jQuery      “   ”   ,       jQuery(expression, [context])   
 *   jQuery    expression   ,            jQuery  ,       
 *
 * @return           “   ”   (      )String
 *
 */
selector예:
alert($("#aa").selector):#aa 반환
alert($("
").selector): 빈 문자열을 반환합니다.
/**
 *       ,    jQuery        (DOM    、    jQuery   ),       jQuery(expression, [context])
 *      jQuery    context   ,            jQuery  ,       (document)
 *
 * @return      jQuery        Element
 */
context예:
alert($("p", $("div")).context);
/**
 *    jQuery        DOM  ,    jQuery     DOM  
 *
 *  @return	DOM    Array<Element>
 */
get()예: 모든 p 요소를 가져와서 자바스크립트의 Array 대상으로 변환하고 그 중의 toString 방법을 호출하여 대상 그룹을 문자열로 표시합니다
alert($("p").get().toString());
/**
 *        ,  index        ,get()     ,$(this).get(0) $(this)[0]  
 *
 * @param  index                  , 0  。
 * 
 * @return  Element,      index       
 */
get(index)예: 생략
/**
 *           ( 0    )
 *  
 * @param  subject      ,   DOM  、jQuery   “   ”   ,    ,    
 *		jQuery                  (document           )   
 *		          ,   -1。(   DOM jQuery    ,             ) 
 *
 * @return      Number
 */
index([subject])예: 생략
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
jQuery 전후 예이 기사에서는 jquery after() 및 before() 메소드의 예를 볼 것입니다. before() 메서드는 선택한 요소 앞에 지정된 콘텐츠를 삽입합니다. after() 메서드는 선택한 요소 뒤에 지정된 콘텐츠...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.