我如何使用
jquery在类名为“blueheaderbar accordionButton on”的div中查找此按钮,然后将按钮值更改为“隐藏它”
<div class="blueheaderbar accordionButton selected" style="margin-top:20px"> <div class="floatleft">abc</div> <div class="floatright"><input class="showhidebtn" type="button" value="Show Outlet" style="margin:6px 16px 0 0; width:86px" /></div> <div class="clear"></div> </div> <div class="blueheaderbar accordionButton" style="margin-top:20px"> <div class="floatleft">abc</div> <div class="floatright"><input class="showhidebtn" type="button" value="Show Outlet" style="margin:6px 16px 0 0; width:86px" /></div> <div class="clear"></div> </div>
解决方法
我认为答案是:
$("div.blueheaderbar.selected").find("input").val("hide it");