MarcelWeidum
MarcelWeidum

Reputation: 145

How to use multiple "Attribute Equals" selector in jquery?

If you want to select a jquery element with 1 attribute that equals a value is simple:

$(".element[attribute1='true']").hide();

But what if you want to select an element with 2 equal attributes?

$(".element[attribute1='true', attribute2='false']").hide();

That won't work.

Upvotes: 3

Views: 4129

Answers (1)

Mohammad
Mohammad

Reputation: 21489

You can use multiple Attribute Equals Selector [name=”value”] in jquery like bottom code:

$(".element[attribute1='true'][attribute2='false']").hide();

Upvotes: 7

Related Questions