在下面的内容中,我想在元素strong上应用- display none样式。如何根据li的id找到元素strong并应用css?
<li id="rowForcustomfield_11300" class="item">
<div class="wrap">
<strong title="REVENUE NET" class="name">REVENUE NET:</strong>
<div id="customfield_11300-val" class="value type-cascading-summary-field editable-field inactive" data-fieldtype="cascading-summary-field" data-fieldtypecompletekey="com.crawco.plugins.jira.company- jira-customfields:cascading-summary-field" title="Click to edit">
</div>
</li>因此,需要如下所示:(在list的引用ID中搜索name类元素)
$("#rowForcustomfield_11300 name") 我们如何使用jQuery来实现这一点。
注意:在上述内容的完整HTML中,有许多list元素,每个元素都包含单个'‘元素,需要找到适用的css。
谢谢
发布于 2013-06-26 14:39:00
您可以使用class-selector查找具有指定类的元素
$("#rowForcustomfield_11300 .name")发布于 2013-06-26 14:42:24
这是FIDDLE
//apply style display 'none'
$('#rowForcustomfield_11300 strong').hide();
//OR
//clear content
$('#rowForcustomfield_11300 strong').html(null);发布于 2013-06-26 14:39:37
尝试:
var li_id ="rowForcustomfield_11300"
$("li#"+li_id ).find(".name").hide();https://stackoverflow.com/questions/17313100
复制相似问题