Digital Point Forums
Wire Transfer

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Jun 16th 2005, 2:40 pm
GoldDog GoldDog is offline
Peon
 
Join Date: Apr 2005
Posts: 5
GoldDog is on a distinguished road
adding vars not text strings

How can I get my function to recognize this...

subt = document.getElementById('subT').innerHTML;

...as a numeric value rather than a text string?

My math...

ty = 23;
subt = document.getElementById('subT').innerHTML;
cost = ty+subt;
document.getElementById('subT').innerHTML = cost;

...does not work. It rewrites 'subT' as a text string, rather than a computed value.

thanks!
Reply With Quote
  #2  
Old Sep 15th 2009, 4:00 pm
gumape gumape is offline
Peon
 
Join Date: Sep 2009
Posts: 21
gumape is on a distinguished road
var num = parseFloat (subt);

More info: parseFloat
__________________
Best JavasScript reference | CSS reference |
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anchor Text - combo image/text link hasm Search Engine Optimization 2 Jan 30th 2008 10:46 pm
Spider Identification Strings for vBulletin Dominic vBulletin 5 Apr 28th 2006 3:28 pm
Search Engines and Query Strings Trance-formation Search Engine Optimization 4 Jun 13th 2005 6:14 am
no rankings for urls with query strings tphyahoo Keyword Tracker 1 Mar 29th 2004 8:08 am


All times are GMT -8. The time now is 3:04 pm.