removing html element styles via javascript -


I'm trying to change an element's inline style tag value. The current element looks like this:

  `& lt; TR class = "row-even" style = "background: red no repeat scrolling 0% 0%; position: relative; -moz-background -clip: -moz- initial; -moz- background-origin: -moz- Initial; -moz-background inline policy: -moz-initial, "id =" 0000ph2009-06-10s1s02 "& gt; ` 

And so much that it's styling from the class instead of it's inline style I want to remove all the style stuff. I have tried to remove the element. Style; And element.style = null; And element.style = ""; no point. My statement on this statement breaks as the whole function looks like:
function unSetHighlight (index) {

  if (index of index of 10; 000) + (000) + ( Index); Else if (index & lt; 100) index = "000" + (index); And if (index Lt; 1000) index = "0" + (index); If (index> gt; = 1000) index = index; Var mainElm = document.getElementById ('active_playlist'); Var elmIndex = ""; For (currElm = mainElm.firstChild;; currElm == null; currElm = currElm.nextSibling) {if (currElm.nodeType === 1) {var elementId = currElm.getAttribute ("id"); If (elementId.match (/ \ b \ d {4} /)) {elmIndex = elementId.substr (0,4); If (elm index == index) {var key = currElm; //that.style.background = Status: Relative; }}}} Clear interval (highlight); Warning ("Interval Approval"); That.style.background = null; Alert (called "Unset Highlight"); }  

The obvious interval works but the warning never fire and the background remains the same. Can anyone see any problem? Thanks in advance ...


  function unSetHighlight (index) {warning (index); If (index and lieutenant; 10) index = "000" + (index); Else if (index & lt; 100) index = "000" + (index); And if (index Lt; 1000) index = "0" + (index); If (index> gt; = 1000) index = index; Var mainElm = document.getElementById ('active_playlist'); Var elmIndex = ""; For (currElm = mainElm.firstChild;; currElm == null; currElm = currElm.nextSibling) {if (currElm.nodeType === 1) {var elementId = currElm.getAttribute ("id"); If (elementId.match (/ \ b \ d {4} /)) {elmIndex = elementId.substr (0,4); Warning ("Elm Indax =" + Elm Index + "Index =" + Index); If (elm index === index) {var key = currElm; Warning ("match found"); }}}} Clear interval (highlight); Warning ("Interval Approval"); That.removeAttribute ("style"); //that.style.position = "relative"; // repaint (); Alert (called "Unset Highlight"); }  

You can do this simply: element.removeAttribute ("style ")


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -