Getting a style name of a <div>

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
User avatar
Virtuoso
php-forum Active User
php-forum Active User
Posts: 267
Joined: Mon Jul 21, 2003 7:05 am
Contact:

Tue Sep 20, 2005 4:58 pm

How do I get the name of a style that the div is using.
For example

Code: Select all

<div style='headerdiv'>


How would I get the string headerdiv?

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Fri Oct 07, 2005 9:13 pm

getElementById('div_name').style ??
Don't know... give it a try :D
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Sun Oct 16, 2005 9:06 pm

I guess you need the class name of the ID and not the style name
try this

Code: Select all

document.('div_name').class

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Sun Oct 16, 2005 9:20 pm

That's it ruturajv :)
So the best way so far... document.getElementById('elem_name').whatever
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest