MyBB Community Forums

Full Version: Javascript help, content replacement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i have this template content loaded from the MyBB header template

<div class="tborder" id="random_quote">
                <div class="thead"><a href="{$mybb->settings['bburl']}/Thread-The-Random-Quote-Thread">
<strong>Random Quotes</strong></a>
<div class="expcolimage">
<img src="{$mybb->settings['bburl']}/images/carpe-noctem/collapse.gif" id="quotes_col" class="expander" alt="[-]" title="[-]" style="cursor: pointer; ">
</div>
                </div>
<p id="quotes"></p>
</div>

and for a particular page I want to remove this portion of the output, so I have a JS file that contains

$('random_quote').innerHTMl = '&nbsp;';

but it does not work. Other lines in the JS file that are coded similarly work just fine but use wrapInner rather than the InnerHTML method.

Basically I want the <div> with id="random_quote" to have it's content removed to result in

<div class="tborder" id="random_quote">
&nbsp;
</div>

nevermind, I had to go about it the long way

var randomElement=document.getElementById('random_quote'),randomHTML=randomElement.innerHTML;(function(){randomElement.innerHTML="";})();