How Can A className be Prevented From Being Applied To a Div, OR, Cleared?
<p>Heck of a puzzle, how to properly set a className to clear it.  Not sure if
I should, for that matter, but here is the situation.</p>

<p>A window.onload function is successfully using  <em>addEventListener</em> for
for these events, [ webkitAnimationEnd &amp; mouseover ] which I then
harness to set className for Divs.  All good so far, but sometimes I want
to display the Div  OUTSIDE of that window.onload function.  So, a button
click with an <code>onclick="wazzupClyde();</code> calls the below function.</p>

<p>Because I have it after the window.onload script, I figured it should be
the script in charge, and want to cancel any className on the div so the
CSS Declaration which is for the Div as normal, or default, will style the
div.  Well, seemed like a plan... but as noted after the code here, it is um...
flawed, yeah.</p>

<pre><code>    &lt;script type="text/JavaScript"&gt;
    function wazzupClyde(){
        var Bid = document.getElementById("Bid");
        Bid.className = (window.WebKitAnimationEvent) ? "x";
    }
    wazzupClyde();
    &lt;/script&gt;
</code></pre>

<p>Saith the DeBugger in my Chrome JavaScript Console:</p>

<p>Tried: </p>

<pre><code>Bid.className = (window.WebKitAnimationEvent) ? "";
</code></pre>

<blockquote>
  <p>Uncaught TypeError: Unexpected token ;</p>
</blockquote>

<p>and also</p>

<pre><code>Bid.className = (window.WebKitAnimationEvent) ? "x":"";
</code></pre>

<blockquote>
  <p>Uncaught TypeError: Cannot set property 'className' of null</p>
</blockquote>

<p>and also</p>

<pre><code>Bid.className = (window.WebKitAnimationEvent) ? "x";
</code></pre>

<blockquote>
  <p>Uncaught TypeError: Unexpected token ;</p>
</blockquote>

<p>plus this</p>

<pre><code>Bid.className = "":
</code></pre>

<blockquote>
  <p>Uncaught TypeError: Unexpected token :  </p>
</blockquote>

<hr>

<pre><code>    &lt;div id="SomeChickenShitz"class="hover"&gt;
   &lt;form action="&lt;?php echo $PHP_SELF; ?&gt;" method="post"&gt;
      &lt;input type="hidden" name="OhGoodOneBubba" value="&lt;?php echo $ForSaleCompetentEWE;?&gt;"/&gt;
        &lt;button id="Bid"type="submit"class="hover" onclick="wazzupClyde();"&gt;WHY?&lt;/button&gt;
       &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>When I try Bid.removeAttribute('className');
get a complaint about "Cannot call method 'removeAttribute' of null"
so I suspect the problem is the code design...
So, recap.  How can I either prevent that Div   <em>Bid</em>  from
having a className applied, OR, clear it?</p>
