Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js] nadawanie klas
$liwa
post
Post #1





Grupa: Zarejestrowani
Postów: 63
Pomógł: 0
Dołączył: 19.07.2006

Ostrzeżenie: (0%)
-----


Witajcie... chciałbym nadać klase CSS z poziomu JS w poniższym skrypcie:
  1. function switchTab(itemID, mode)
  2. {
  3. element = document.getElementById(itemID);
  4. subelement = document.getElementById('con_' + itemID);
  5.  
  6. if(mode == 1)
  7. {
  8. element.style.visibility = 'hidden';
  9. }
  10. else
  11. {
  12. element.style.visibility = 'visible';
  13. }
  14. }

jak widać, moge zastosować element.style.parametr = 'wartosc', a jak nadać klasę obiektowi?
btw: element.class = 'bla'; - nie dziala
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


DOM:element.className
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 12:50