Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Browser Side
/
JavaScript and AJAX
2:29 am May 14, 2026
This page requires javascript.
Forum Moderators:
open
Message Too Old, No Replies
Strip "px" from a variable
MartinWeb
Msg#:4024117
10:43 pm on Nov 12, 2009
(gmt 0)
What is the easiest way to strip the letters "px" from a variable? Any help would be great.
MartinWeb
Msg#:4024121
10:47 pm on Nov 12, 2009
(gmt 0)
I just realized the parseInt works. I'm not sure why. Please ignore this post.
Receptional Andy
Msg#:4024122
10:48 pm on Nov 12, 2009
(gmt 0)
You can use replace()
var str="20px";
document.write(str.replace("px", ""));
MartinWeb
Msg#:4024130
10:54 pm on Nov 12, 2009
(gmt 0)
Oh! Thank you. I'll keep that in mind. :)
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
May 2026 Google Search Observations
AdSense Earnings and Observations - May 2026
Country Removal notice from Google Search
SEO question
Page indexed but live url test gets 500 error
Sitemaps for large websites and SEO - add everything or just some?
reverse() -- ColdFusion(or your language)/SQL + JavaScript
Home
Forums Index
Browser Side
/
JavaScript and AJAX
2:29 am May 14, 2026