I am using HAML to implement a user display in a page
%li
%label.user
%input{value: "<%= user.nickname %>", type: "<%= user.type %>", user_avatar: "<%= user.avatar_url %>"}
%img{src: "<%= user.avatar_url %>"}
.name <%= user.nickname %>
I have 2 user types, “friends” or “followings”. My intention is to find and hide all the ‘li’s with the type = ‘following’. How can I do this?
I tried with the following code to no avail.
@$('ul.inputs-list li').find('input').attr('type'=='following').hide()
Can anyone advise me on how to modify my code so that I can hide all ‘li’s with type=’following’?
Use the attribute selector: