开发者

How do I query this in Javascript?

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

$(".room with attribute "data开发者_如何学C-people=jason").hide();

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


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

demo


Like this:

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


This should do the trick:

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


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜