# Why won't my script work in IE6

**URL:** <https://forum.kirupa.com/t/why-wont-my-script-work-in-ie6/273050>\
**Category:** web dev\
**Created:** [October 10, 2008, 3:25pm UTC](https://forum.kirupa.com/t/why-wont-my-script-work-in-ie6/273050 "2008-10-10T15:25:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikomax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nikomax/32/3664_2.png) [@nikomax](https://forum.kirupa.com/u/nikomax)\
**Post date:** [October 10, 2008, 3:25pm UTC](https://forum.kirupa.com/t/why-wont-my-script-work-in-ie6/273050/1 "2008-10-10T15:25:54Z")

</div>

Hi there everyone!

I have looked for a good while now and have decided to ask you lovely people one again!!

I have this JS code

```auto
function smHide(Target){
    var div = document.getElementById(Target).style;
    if(div.display !== 'none'){
        div.display = 'none';
    }else{
        div.display = 'block';
    }
}

```

And this here HTML…

```auto

            <div class="box">
                <div class="titleBox" onclick="smHide('text1');">
                    <div class="title" >Welcome to my site</div>
                    <div class="hideBox"><img src="images/png-24/16-em-down.png" /><br />- Hide / Show Article -</div>
                </div>
                <div id="text1" class="text">
                    
                    Fusce dolor. Vivamus ipsum pede, hendrerit vel, accumsan quis, Text omitted!
                </div>
            </div>

```

Right~  
So in FF and IE7 this works as it should, You click anywere on the title bar and the text in the box gets hidden. But for the life of me i have no idea why this will not work in IE6, other then its IE and it likes to dishout free headaches.

I’m hoping this is just a simple mistake I may of made somewhere, I dont really JS a lot so heres to hoping!

Thanks!

[EDIT]

I think I have narrowed the problem down to iepngfix.htc! Does anyone have an idea why this is happening? I only apply the fix to img and div tags.
