Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to determine if width has px or %
- var value = $('#id').get(0).style.width;
- var hasPx = value.indexOf('px') >= 0;
- var hasPct = value.indexOf('%') >= 0;
- $("<div style='width:50px'>").get(0).style.cssText // "width: 50px; "
- $("<div style='width:50% '>").get(0).style.cssText // "width: 50%; "
Add Comment
Please, Sign In to add comment