Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Design

getElementById Not Working?

Author Message
collin



Joined: 02 May 2005
Posts: 17

Posted: Fri May 20, 2005 - 2:51 am    Post subject: getElementById Not Working? Reply with quote

I'm working on a widget, and need to simply change the text inside a <div> element, and everywhere I look I see document.getElementById() being used. I made use of it, and only the first line of the following code is broken, yet the second line executes fine. Why would this happen? (if it makes a difference, I'm not in the setup() function...I'm using one that gets called when a button is clicked)

document.getElementById('response').value="Success";
document.getElementById('response').style.display = 'none';
View user's profile Send private message Widgets
Chris



Joined: 27 Jan 2005
Posts: 344
Location: Durham, UK

Posted: Fri May 20, 2005 - 3:11 am    Post subject: Reply with quote

It's because .value is only form form elements. Since you're using a div, use innerText or innerHTML.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
collin



Joined: 02 May 2005
Posts: 17

Posted: Fri May 20, 2005 - 3:18 am    Post subject: Reply with quote

Chris wrote:
It's because .value is only form form elements. Since you're using a div, use innerText or innerHTML.


Thanks! That's been bugging me for the past half hour!
View user's profile Send private message Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group