baaroz
baaroz

Reputation: 19587

multiple class selector in jquery

I have this css role

.sf-menu a.sf-with-ul{padding-left:20px}

I want to change this role using jquery

I tried without success the following commands

$(function()
{
     $("a.sf-with-ul").css("padding-left", "10px");
     $("a").hasClass(".sf-with-ul").css("padding-left", "10px");
     $("a").filter(".sf-with-ul").css("padding-left","10px")
});

What is the problem?

p.s

I do I change the roll of this css using jquery?

.sf-menu li ul li a

Upvotes: 1

Views: 55

Answers (2)

Mandeep Pasbola
Mandeep Pasbola

Reputation: 2639

Try this :

$(function()
{
 $(".sf-menu a.sf-with-ul").css("padding-left", "10px");
});

Upvotes: 2

Alessandro Minoccheri
Alessandro Minoccheri

Reputation: 35973

Try to put !important like this:

$(function()
{
     $("a.sf-with-ul").css("padding-left", "10px !important");
     $("a").hasClass(".sf-with-ul").css("padding-left", "10px !important");
     $("a").filter(".sf-with-ul").css("padding-left","10px !important")
});

Upvotes: 0

Related Questions