This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes jQuery Cannot Find DOM Element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jQuery Cannot Find DOM Element" Watch "jQuery Cannot Find DOM Element" New topic
Author

jQuery Cannot Find DOM Element

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
I do not understand why $('#msgProgress').val() returns undefined

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Because spans don't have values.

Your title is way off -- jQuery is finding the element just fine. Then you are asking it to return something that does not exist. No surprise that you get undefined.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
Bear Bibeault wrote:Because spans don't have values.

Your title is way off -- jQuery is finding the element just fine. Then you are asking it to return something that does not exist. No surprise that you get undefined.


The reason I was testing for value is because I have tried to attach a click event to the span id. I could not get it to fire so I just trying to use something to see if the dom recognized the id or not.

Anyway I cannot get the following to fire.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

SSCCE
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jQuery Cannot Find DOM Element
 
Similar Threads
scroll bar down
Control Image Size
CSS Selector for Embeded DIV
Center a Container on the Page
Span contents overflowing even though specified overflow as hidden