clear IE filter from form img's

Discussion in 'JavaScript' started by StealthRT, Jun 3, 2008.

  1. #1
    Hey all i am trying to figure out a way to clear my 120+ images that are inside my form. I can do this right now by using the following code:
    
    onmouseup="this.style.filter='';"
    
    Code (markup):
    However, that has to be present for every image and i really would like to clear them all (since it seems sometimes the filter stays on the image even if i release my mouse button. This will allow for it to clear even if i hit another image since it will be looping though all of them.

    Is there any way to mod this code that i found to look for the '<img' tag within the form and clear them all in a loop?
    
    <script type="text/javascript">
    function clearFilter(){
    for( var elem, i = 0; ( elem = document.test.elements[i] ); i++ )
    {
    	elem.style.filter='';
    }
    }
    </script>
    
    <form name="test">
    <input type="text" value="" /></p>
    <div align="center"><img src="file:///c:/images/ButtonU.png" alt="" width="100" height="100" onClick="clearFilter();" onmousedown="this.style.filter='progid:DXImageTransform.Microsoft.BasicImage(XRay=1)'; " onmouseup="this.style.filter='';" /><bR>
    <br>
    <input type="button" value="submit" name="submitButton">
    </div>
    </form>
    
    Code (markup):
    Thanks for your time,
    David
     
    StealthRT, Jun 3, 2008 IP