How can I get DOM elements by class, id, selectors (div > .my-i
) and properties like in jQuery?
For example:
<div class="myClass" style="width:200px">
<span id="pop">test</span>
<div>
<i>aaa</i>
<i class="my-i">bbb</i>
<i class="my-i">ccc</i>
</div>
I need to get:
- value 200px by class
- text 'test' by id
- all by class="my-i"
What's the best way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…