I'm having an oddly difficult hiding an html table with javascript/jQuery. I've tried both of the following:
document.getElementById('tblQuickTools').style.display = 'none';
$('#tblQuickTools').hide();
I've stepped through the code to make sure the lines are being hit. The HTML for the table is below.
<table cellpadding="0" cellspacing="0" width="38%" id="tblQuickTools">
<tr>
<td class="outerTableTopLeftSmall">
</td>
<td colspan="4" class="outerTableTopRepeatSmall">
</td>
<td class="outerTableTopRightSmall">
</td>
<td class="outerTableTopLeftSmall">
</td>
<td colspan="2" class="outerTableTopRepeatSmall">
</td>
<td class="outerTableTopRightSmall">
</td>
</tr>
<tr>
<td class="outerTableLeftRepeatSmall">
</td>
<td colspan="4">
<img src="identity.gif" border="0" />
<strong><big>Quick Tools</big> </strong>
</td>
<td class="outerTableRightRepeatSmall">
</td>
</tr>
<tr>
<td class="outerTableLeftRepeatSmall">
</td>
<td colspan="4">
<strong>
<hr />
</strong>
</td>
<td class="outerTableRightRepeatSmall">
</td>
</tr>
<tr>
<td class="outerTableLeftRepeatSmall">
</td>
<td>
<a id="btnDownloadAll" onclick="LaunchSignOffMultiDownloader(this);this.blur();return false;"
href="javascript:void(0);" class="btnMed"><span>Download All</span> </a>
</td>
<td>
</td>
<td>
<a id="btnReplaceAll" onclick="LaunchSignOffMultiUploader(this, true);this.blur();return false;"
href="javascript:void(0);" class="btnMed"><span>Replace All</span> </a>
</td>
<td>
<a id="btnRetainAll" onclick="RetainAllSignOffDocuments();this.blur();return false;"
href="javascript:void(0);" class="btnMed"><span>Retain All</span> </a>
</td>
<td class="outerTableRightRepeatSmall">
</td>
</tr>
<tr>
<td class="outerTableBotLeftSmall">
</td>
<td colspan="4" class="outerTableBotRepeatSmall">
</td>
<td class="outerTableBotRightSmall">
</td>
</tr>
</table>
I checked and tblQuickTools is loaded. So it's not a loading issue. I could try using $(document).ready() but I'm apprehensive about it. tblQuickTools is inside a tab which is inside an aspx page which sits in a Master Page. The tab is loaded through AJAX when clicked on. The hide code runs in the tabLoaded() function. If I used $(document).ready() I'm not sure which document ready it would fire on, the tab, the page or the master page.