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
8:28 am Jun 28, 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
,
May
,
Apr
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
June 2026 Google Search Observations
AdSense Earnings and Observations - June 2026
Quite quiet in here, anyone know why?
Best Learning Path for a Web Development Beginner?
Good Bye AdWords - or whatever you call it these days
Buying traffic to appear on Google Discover
Home
Forums Index
Browser Side
/
JavaScript and AJAX
8:28 am Jun 28, 2026