jQquery选取元素

$("#id").parent(); 所有父级元素

$("#id").children();所有子级元素

$("#id").next();下一个兄弟节点

$("#id").prev();上一个兄弟节点

$("#id").children(":first");第一个子级元素

$("#id").children(":last");最后一个子级元素

$("#id").children().eq(0);第一个子级元素

<td class="yPd">
   <input id="project_C05" class="combotree-f combo-f textbox-f" type="text" data-options="required:true " disabled="disabled" style="display: none;" textboxname="project.C05" comboname="project.C05">
   <span class="textbox textbox-disabled combo" style=" 258.4px; height: 20.4px;">
      <span class="textbox-addon textbox-addon-right" style="right: 0px;">
      <span id="historyC05" title="其他仓储业">
         <input class="textbox-text validatebox-text" type="text" autocomplete="off" disabled="disabled" readonly="readonly" placeholder="" style="margin-left: 0px; margin-right: 18px; padding-top: 0px; padding-bottom: 0px;  232.4px; background-color: yellow;">
      </span>
     <input class="textbox-value" type="hidden" name="project.C05" disabled="disabled" value="0111">
   </span>
</td>

$("#project_C05").next().children().eq(1).children(":first").css('backgroundColor','yellow');

设置

<input class="textbox-text validatebox-text" type="text" autocomplete="off" disabled="disabled" readonly="readonly" placeholder="" style="margin-left: 0px; margin-right: 18px; padding-top: 0px; padding-bottom: 0px;  232.4px; ">
的背景色为黄色
原文地址:https://www.cnblogs.com/xiao-fy/p/5103661.html