How to remove padding if the heading has no background image?

Viewed 54

There are numerous headings and some has background image as bullets and for that purpose the headings are given padding-left: 35px; now by some reasons some headings hasn't background image. Thus, I wanted to remove the padding-left value by applying 0 pixel. How can I do something like this?

jQuery(document).ready(function(){
    var ts = $('h1,h2,h3,h4,h5,h6');
    if(!ts.style.background) ts.css({'padding-left':'0px'});
});

The above code didn't work. Please note: also the background image is given by using background or background-image

1 Answers
Related