title: How do I get element's className inside loop of elements?
body: <p>I am trying to create a function that given a divid, and a list of classes, will then do some text replacing inside them.</p>
  
  <p>Having learned of how Firefox Dom is handling text nodes differently, I read that I had to use javascript to loop through the elements, sibling to nextSibling. </p>
  
  <p>The last obstacle I had in my script, of which you see a small portion of, is getting the classname. I need the class name so that I can filter down what content get's text replaced.</p>
  
  <p>Having looked all the answers, and with the help of a co-worker named Ryan at work, we have redone this in jquery.</p>
  
  <pre><code>        $(divid).find(".status_bar").each( function() {
          var value = $.trim($(this).text());
          // if value is not defined thru browser bugs do not replace
          if (typeof(value) != 'undefined') {
              // it is a text node. do magic.
              for (var x = en_count; x &gt; 0; x--) {
                  // get current english phrase
                  var from = en_lang[x];
                  // get current other language phrase
                  var to = other_lang[x];
                  if (value == from) {
                      console.log('Current Value ['+value+'] English ['+from+'] Translation ['+to+']');
                      value = to;
                      $(this).attr('value', to);
                  }
              }
          }
      });
  </code></pre>
  
  <p>This currently works in all areas, except in the replacing of text. </p>
  
  <p>The reason I had originally with doing this in jQuery, had to be not sure I could loop thru elements, and avoid the problem with firefox and text nodes.</p>
  
  <p>I am doing a loop of all elements inside a div, and I now need to get the classname of the element that I am looping by.</p>
  
  <p>Then i can check if the current element's class is one, I need to do something with...</p>
  
  <pre><code> // var children = parent.childNodes, child;
      var parentNode = divid;
  
      // start loop thru child nodes
      for(var node=parentNode.firstChild;node!=null;node=node.nextSibling){
  
      var myclass = (node.className ? node.className.baseVal : node.getAttribute('class'));
  
      }
  </code></pre>
  
  <p>But this code for getting the classname only get's null values.</p>
  
  <p>Any suggestions?</p>
  
  <p>For those of you who are trying to figure out what the whole point is, read this <a href="http://www.agavegroup.com/?p=32" rel="nofollow noreferrer">JavaScript NextSibling Firefox Bug Fix</a> I have code that does my language translation that works in Google Chrome and IE. But when I use it in Firefox, and try to translate div content after ajax has loaded it, it fails because of the whitespace issue. </p>
  
  <p>I really don't have a preference of jQuery or Pure Javascript, I just want a working solution. </p>
  
  <p>Thank you all for being patient. I personally thought I was extremely clear in my description, I apologize if it wasn't. I wasn't trying to be obscure or make it difficult to get help. But please don't insult me, by implying I am trying to make it unclear.</p>
  
  <p>Thanks.</p>