U
U
uzi_no_uzi2018-02-11 13:44:59
css
uzi_no_uzi, 2018-02-11 13:44:59

Why are the dropdown lists not working?

Code: https://jsfiddle.net/jr3dccdq/ Dropdown
not working when adding

if(this.lastChild.previousSibling.style.display == 'none')
without this comparison operator, everything works, apparently thisinside ifit somehow works differently, but I don’t understand how
. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivanq, 2018-02-11
@uzi_no_uzi

Well of course it doesn't work. The style field is properties set via style=""HTML or .style.x = yJS. If the property is set via a CSS selector, it will be an empty string.
Corrected example: https://jsfiddle.net/Ivanq/jr3dccdq/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question