M
M
MrCroissant2015-09-26 16:52:33
JavaScript
MrCroissant, 2015-09-26 16:52:33

How to refer to an element in javascript by its properties?

There is an element:

<div class="piece wall us ds" style="left:100%; top:120%"></div>

You need to access it with style="left:100%; top:120%"
Using Jquery, you can access it like this: $(".wall[style='left:80%; top:120%']")
Through CSS, like this: .wall[style='left:100%; top:120%']{}
How can it be accessed in pure javascript in a similar way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2015-09-26
@MrCroissant

querySelectorAll

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question