0
    <div class="room" data-people="jason">
    blah blah
    </div>

$(".room with attribute "data-people=jason").hide();

I want to select the room where data-people = jason, and then hide it.

4 Answers 4

2
   <div class="room" data-people="jason">
     blah blah
   </div>
   <script>
       $(".room[data-people='jason']").hide();
   </script>

demo

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

Comments

1

Like this:

$(".room[data-people=jason]").hide();

Comments

1

This should do the trick:

$('.room[data-people=jason]').hide();

Comments

1
$('.root[data-people="jason"]').hide()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.