Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

Getting a style name of a <div>

Javascript coding ..

Moderators: macek, egami, gesf

Getting a style name of a <div>

Postby Virtuoso » 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
Virtuoso
php-forum Active User
php-forum Active User
 
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am

Postby gesf » Fri Oct 07, 2005 9:13 pm

getElementById('div_name').style ??
Don't know... give it a try :D
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby ruturajv » 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
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby gesf » Sun Oct 16, 2005 9:20 pm

That's it ruturajv :)
So the best way so far... document.getElementById('elem_name').whatever
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.