...

View Full Version : Getting the Title from and HTML element



lobsterninja
08-31-2006, 08:57 PM
I was just wondering (sorry this may be a dumb question, I've never really worked with JavaScript) if there is a way to get the title from an HTML element after I get the element by its ID. Thanks for the help.

Basscyst
08-31-2006, 09:32 PM
Yup:



var objtitle=obj.getAttribute('title');


Basscyst

lobsterninja
09-01-2006, 04:06 AM
So if I do:


var objecttitle=document.getElementById('elementId').getAttribute('title');

I will be able to get the title of the element with the id 'elementId'?
Thanks :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum