我想隱藏一個表格行但我的表沒有ID。由於這是SharePoint代碼,我無法在其中添加ID。沒有ID的CSS選擇器
<td width="99%" class="ms-authoringcontrols">
<table width="100%" class="ms-authoringcontrols">
<tbody><tr><td>
<input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$InputFile" title="Choose a file" class="ms-fileinput ms-fullWidth" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile" onfocus="ResetSpFormOnSubmitCalled();" onchange="CheckAssetLibMediaExtension()" type="file" size="35">
</td></tr>
<tr><td>
<span class="ms-error" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00" style="display: none;"><span role="alert">You must specify a value for the required field.</span></span>
<span id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01" style="display: none;">The file name is invalid or the file is empty. A file name cannot contain any of the following characters: \/: * ? " < > | # { } % ~ &</span>
</td></tr>
<tr><td>
<a id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OpenWithExplorerLink" accesskey="E" onclick="javascript:return !LaunchOpenInExplorer();" href="#">Upload files using Windows Explorer instead</a>
</td></tr>
<tr><td>
<input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$OverwriteSingle" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OverwriteSingle" type="checkbox" checked="checked"><label for="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OverwriteSingle">Overwrite existing files</label>
</td></tr>
</tbody></table>
</td>
我想隱藏上表中的第4行。輸入contrains ID,但不知它不工作
<tr><td>
<input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$OverwriteSingle" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OverwriteSingle" type="checkbox" checked="checked"><label for="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OverwriteSingle">Overwrite existing files</label>
</td></tr>
你忘了我們表明,你說是不是工作的實際代碼。 – BoltClock
雖然我不知道代碼的其餘部分是什麼樣的,但我建議你嘗試一下:'table.ms-authoringcontrols tr:nth-child(4){...}' –
@Ofir Baruch:爲什麼jQuery的必要? – BoltClock