0

It might be repeated question but still need of time is that I want a solution. I am new to CSS and jQuery, so here is what I am looking for. I have a css like this

.my-selector { 
    background-size: cover;
    something-here1 : 2;
}

Now I want to check whether this my-selector has backgroud-size as one of the elements or not, if it has then I want to add new element in same selector. This I want to do in JavaScript or using jQuery

0

1 Answer 1

0

btw: jQuery IS javascript.

if (!$(this).hasClass("my-selector")) {
   //rlemons post [link below] deals with this
}

look here for rlemon's anwer for the this part

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.