在动态生成的列表中选择列表元素
<div id="carat_weight_right" style="margin-top: 15px;float:left;width:444px;border-width:1px 0px 1px 0 ;border-style:solid; border-color:#327B84;padding-top:10px;padding-bottom:33px;*padding-bottom:59px;">
<fieldset style="padding-left:20px;padding-bottom:10px;width:415px;margin-top:3px;font-size;10px;">
<--- start auto gen using js / java third party tool for sliders using the filament slider tool ---->
<ol class="ui-slider-scale ui-helper-reset" role="presentation">
<li style="left:0.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -11.5px; ">FAIR</span><span class="ui-slider-tic ui-widget-content" style="display: none;"></span></li>
<li style="left:25.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -15.5px; ">GOOD</span><span class="ui-slider-tic ui-widget-content"></span></li>
<li style="left:50.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -15.5px; ">VERY GOOD</span><span class="ui-slider-tic ui-widget-content"></span></li>
<li style="left:75.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -15px; ">IDEAL</span><span class="ui-slider-tic ui-widget-content"></span></li>
<li style="left:100.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -30px; ">SIGNATURE IDEAL</span><span class="ui-slider-tic ui-widget-content" style="display: none;"></span></li></ol>
<--- end auto genereted list ---->
</fieldset>
</div>
我想做的是能够选择这个 < li style="left:100.00%" >并更改上面的跨度样式< li style="left:100.00%" > ?
我如何选择特定的 < li style="left:100.00%" >且跨度在< li style="left:100.00%" >使用jquery?
谢谢
<div id="carat_weight_right" style="margin-top: 15px;float:left;width:444px;border-width:1px 0px 1px 0 ;border-style:solid; border-color:#327B84;padding-top:10px;padding-bottom:33px;*padding-bottom:59px;">
<fieldset style="padding-left:20px;padding-bottom:10px;width:415px;margin-top:3px;font-size;10px;">
<--- start auto gen using js / java third party tool for sliders using the filament slider tool ---->
<ol class="ui-slider-scale ui-helper-reset" role="presentation">
<li style="left:0.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -11.5px; ">FAIR</span><span class="ui-slider-tic ui-widget-content" style="display: none;"></span></li>
<li style="left:25.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -15.5px; ">GOOD</span><span class="ui-slider-tic ui-widget-content"></span></li>
<li style="left:50.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -15.5px; ">VERY GOOD</span><span class="ui-slider-tic ui-widget-content"></span></li>
<li style="left:75.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -15px; ">IDEAL</span><span class="ui-slider-tic ui-widget-content"></span></li>
<li style="left:100.00%"><span class="ui-slider-label ui-slider-label-show" style="margin-left: -30px; ">SIGNATURE IDEAL</span><span class="ui-slider-tic ui-widget-content" style="display: none;"></span></li></ol>
<--- end auto genereted list ---->
</fieldset>
</div>
what i would like to do is to be able to select this < li style="left:100.00%" > and change the span style within the above < li style="left:100.00%" > ?
how can i select the particular < li style="left:100.00%" > and span within the < li style="left:100.00%" > using jquery ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
css 会截断小数点。
The css truncates the decimal points.
如果它始终是最后一个,如发布的代码中所示,您可以执行以下操作:
获取 li.然后要获得跨度,您可以这样做:
获得跨度。 (注意:如果您只需要跨度,则可以将它们组合起来)
编辑:如果您不能依赖它是最后一个,则需要像这样循环它们:
If it is always the last one, as in the posted code, you can do something like this:
to get the li. Then to get the span within you can do this:
to get the span. (Note: if you only need the span, these can be combined)
EDIT: if you can't rely on it being last, you'll need to loop through them like so:
看看这个演示
Take look at this Demo