Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  28] [ 4]  / answers: 1 / hits: 18209  / 11 Years ago, wed, october 2, 2013, 12:00:00

If you have the following element:



<span style=width:100px></span>


and the css is:



span {width:50px!important;}


Is there a way I can get the inline-style value and ignore the css value?



Thanks


More From » jquery

 Answers
44

use element.style.width



sample:



$(function(){
alert($(span)[0].style.width);
});

[#75284] Tuesday, October 1, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raymondd

Total Points: 620
Total Questions: 112
Total Answers: 94

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
raymondd questions
Thu, Apr 22, 21, 00:00, 3 Years ago
Thu, Jul 9, 20, 00:00, 4 Years ago
Thu, Apr 9, 20, 00:00, 4 Years ago
Thu, Jul 25, 19, 00:00, 5 Years ago
;