# Dhtml - change css properties of a class

**URL:** <https://forum.kirupa.com/t/dhtml-change-css-properties-of-a-class/279021>\
**Category:** Uncategorized\
**Created:** [January 8, 2009, 5:34pm UTC](https://forum.kirupa.com/t/dhtml-change-css-properties-of-a-class/279021 "2009-01-08T17:34:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlk](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@mlk](https://forum.kirupa.com/u/mlk)\
**Post date:** [January 8, 2009, 5:34pm UTC](https://forum.kirupa.com/t/dhtml-change-css-properties-of-a-class/279021/1 "2009-01-08T17:34:02Z")

</div>

hello kirupians

im having a hard time figuring this one out

I want to change the visibility property of a certain class. I can’t use unique IDs for the spans so I’m at lost. My html looks a bit like

```php

<span class="details">version 1</span> Some awesome text <br />
<span class="details">version 2</span> More awesome text <br />

```

I’d like to change the .display = hidden of the ‘details’ class but can’t figure out how.  
Any ideas ?

It seems I need to use getElementsByTag(‘details’) if I’m not mistaken, but I’m very confused !

Thanks =)

edit: it has to work on IE6 =(
