jQuery traverse - find using

 

jQuery find() method

The find() method returns the descendant elements of the selected element, all the way down to the last descendant.

The following example returns all <span> elements that are descendants of <div>:

 

$(document).ready(function(){
  $("div").find("span");
});

 The following example returns all descendants of <div>:

 

 

$(document).ready(function(){
  $("div").find("*");
});

 

   Case:

     Modify the button name "Fill Button" to "Write Button"

<a selfbutton="" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-edit" id="gb" plain="true" onclick="dubanTaskForm.addDealWithSituation(formId);" href="javascript:void(0);" group="" style="display: inline-block;">
   <span class="l-btn-left">
     <span class="icon-edit"></span>
     <span class="l-btn-text">Fill in button</span>
   </span>
</a>

    

    jQuery written

$("#gb").find("span").find(".l-btn-text").html("修改后");

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326248829&siteId=291194637