You need to get the contents of the element as $('foo') is the element 
itself ..

innerHTML or innerTEXT should work ...

var total=$('foo').innerTEXT;
alert(parseFloat(total));
----- Original Message ----- 
From: "Scott" <[EMAIL PROTECTED]>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Thursday, November 06, 2008 2:06 AM
Subject: [Proto-Scripty] Simple $( ) question


>
> If I have an element:
>
>  <span id='foo'>50</span>
>
> Should I be able to say the following?
>
>  var total = parseFloat($('foo'));
>
> Instead, I am getting a return value of:
>
>  [object HTMLSpanElement]
>
> and parseFloat is returning NaN.
>
> Thanks in advance.
>
> >
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to