Jquery 基于类和标题隐藏SPAN标记上的文本
我想将内容隐藏在Jquery 基于类和标题隐藏SPAN标记上的文本,jquery,css,html,Jquery,Css,Html,我想将内容隐藏在标记内,但要使用特定文本: <span class="ms-RadioText" title="Created / Criar"><input id="ctl00_m_g_178a35bf_4d92_4887_8b39_b6e6e11d4a09_ff21_ctl00_ctl00" type="radio" name="ctl00$m$g_178a35bf_4d92_4887_8b39_b6e6e11d4a09$ff21$ctl00$RadioButtons" v
标记内,但要使用特定文本:
<span class="ms-RadioText" title="Created / Criar"><input id="ctl00_m_g_178a35bf_4d92_4887_8b39_b6e6e11d4a09_ff21_ctl00_ctl00" type="radio" name="ctl00$m$g_178a35bf_4d92_4887_8b39_b6e6e11d4a09$ff21$ctl00$RadioButtons" value="ctl00" checked="checked" /><label for="ctl00_m_g_178a35bf_4d92_4887_8b39_b6e6e11d4a09_ff21_ctl00_ctl00">Created / Criar</label></span>
<span class="ms-RadioText" title="Change / Alterar"><input id="ctl00_m_g_178a35bf_4d92_4887_8b39_b6e6e11d4a09_ff21_ctl00_ctl01" type="radio" name="ctl00$m$g_178a35bf_4d92_4887_8b39_b6e6e11d4a09$ff21$ctl00$RadioButtons" value="ctl01" /><label for="ctl00_m_g_178a35bf_4d92_4887_8b39_b6e6e11d4a09_ff21_ctl00_ctl01">Change / Alterar</label></span>
Created/Criar
改变/改变
我必须隐藏类“ms RadioText”的内容和标题标记“Created/Criar”,因此只需针对该元素即可:
$('span.ms-RadioText[title="Created / Criar"]').hide();
注意:属性选择器也适用于CSS3。以下jQuery选择器适用于您:
//This removes it from the page
$('span.ms-RadioText[title="Created / Criar"]').hide();
//same as above
$('span.ms-RadioText[title="Created / Criar"]').css('display', 'none');
//This makes it invisible, but it still exists in document flow
$('span.ms-RadioText[title="Created / Criar"]').css('visibility', 'none');
$('span.ms-RadioText[title="Created / Criar"]')
通过将其与jQuery的函数组合,如下所示,您应该可以得到预期的结果:
$('span.ms-RadioText[title="Created / Criar"]').hide();
这里有一个您可以使用选择器标题:
.ms-RadioText[title='Created / Criar']
{
display: none;
}
正在进行演示。您是否正在寻找CSS解决方案?您是否在title属性或label标签中寻找“Created/Criar”?