开发者

How do I query this in Javascript?

开发者 https://www.devze.com 2023-03-25 16:06 出处:网络
<div class=\"room\" data-people=\"jason\"> blah blah </div> $(\".room with attribute \"data开发者_如何学C-people=jason\").hide();
    <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

精彩评论

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

关注公众号