B
B
buymyopps2021-06-08 08:04:53
JavaScript
buymyopps, 2021-06-08 08:04:53

How to assign a property to elements?

Hello. I'm just learning JS so far and I need to assign a property to css elements through an each loop.

list = $('.card')

$.each(list, function(index, value){
value.css('display', 'none')
})


But this code throws errors.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sharomet, 2021-06-08
@buymyopps

You learn jquery, learn js first

$('.card').each(function(){
$(this).css('display', 'none')
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question