Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var stuff = $('#block').css("left")
- 1008px
- parseInt(stuff);
- String.prototype.left = function(n) {
- return this.substring(0, n);
- }
- var num = "1008px".left(4);
- var value = "1080px";
- var num = value.replace(/[^d]+/g, '');
- // or
- var num = value.replace(/D+/g, '');
- // or
- var num = value.match(/d+/)[0];
Add Comment
Please, Sign In to add comment