Erm... stupid answer for a stupid comment.
But, why don't you just use .val() instead of .text() to extract the
information you want with a method actually meant for doing what you
want, rather than try to make jQuery repurpose a method meant for a
completely different purpose?
~Daniel Friesen (Dantman, Nadir-Seen-Fire)
Thomas wrote:
> Dear jQuerians,
>
> I have learned about jQuery a couple of days and now I am using it all
> over my code ;-).
>
> I have a problem and a solution.
>
> Then I use $('#inputElement').text() to get the value of an input
> element, I receive an empty string. It turns out it is because:
> 1) the text function is extracting the text only from the children
> nodes.
> 2) .nodeValue is used to get the content of the DOM node that in case
> of INPUT element returns an empty string.
>
> The solution I am proposing is to here http://paste.pocoo.org/show/111208/
> It deals with two cases - when there are children elements or not and
> it checks for bouth .value attribute and .nodeValue attributes.
>
> I hope this will help.
>
> Regards,
> Thomas
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---