Casey Crookston
Casey Crookston

Reputation: 13965

Not able to get value from div using jQuery

I'm missing something obvious here. A pic is worth 10k words. These are some screenshots from a DOM debug in Chrome.

HTML:

enter image description here

Looking at the script, paused in debug:

enter image description here

Why is ammount not populating? (Ignore the misspelling of ammount... I'll fix it!!)

Upvotes: 0

Views: 173

Answers (1)

Thirk
Thirk

Reputation: 593

.val() is for form inputs, not text inside of divs. You can get the amount using .text() or .html() in place of val.

Upvotes: 7

Related Questions