我对 JQuery 还很陌生,不知道如何执行我想要的查询。
我正在使用 SharePoint,当使用“外部数据列”并将其设置为必填字段时,错误消息总是出现,直到您填写数据。与其他类型的列不同,它们只会在您单击“确定/保存”且未填写数据时才会出现。因此,我需要仅从这些类型的列中删除错误消息文本。
我假设我需要搜索包含“External Data”字样的.ms-error类内的 span 并将其隐藏。
通过使用 IE 开发人员工具栏,我已经确定了该区域。
<table class="ms-usereditor" id="ctl00_m_g_05df537a_596b_443a_a11e_764069facec8_ctl00_Field_External_539c53fe_8334_43c8_b089_cc28d7895e68_Picker_OuterTable" style="border-collapse: collapse;" border="0" cellSpacing="0" cellPadding="0">
<tbody>
<tr>
<td colSpan="3">
<span class="ms-error" id="ctl00_m_g_05df537a_596b_443a_a11e_764069facec8_ctl00_Field_External_539c53fe_8334_43c8_b089_cc28d7895e68_Picker_errorLabel">
Text - You must specify a value before using the Check button. You can also use Select button to choose External Data.
</span>
</td>
</tr>
</tbody>
</table>
请有人能帮助我使用 JQuery。
.empty()
和.text('')
做的是同样的事情。 - Moin Zaman.text(' ')
。这个方法非常好用,因为它可以清除DOM中的内容。 - Casey Robinson