Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
tooltip get
(version: 0)
Comparing performance of:
container from vs from tooltips vs from tooltips 2
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div class="js-tooltip-container"> <button class="js-tooltip-opener" aria-controls="1">開く</button> <div id="1" class="js-tooltip"></div> </div> <div class="js-tooltip-container"> <button class="js-tooltip-opener" aria-controls="2">開く</button> <div id="2" class="js-tooltip"></div> </div> <div class="js-tooltip-container"> <button class="js-tooltip-opener" aria-controls="3">開く</button> <div id="3" class="js-tooltip"></div> </div> <div class="js-tooltip-container"> <button class="js-tooltip-opener" aria-controls="4">開く</button> <div id="4" class="js-tooltip"></div> </div>
Tests:
container from
class Tooltip { constructor(container) { this.container = container; this.opener = this.container.getElementsByClassName('js-tooltip-opener')[0]; this.self = this.container.getElementsByClassName('js-tooltip')[0]; } } const containers = Array.from(document.getElementsByClassName('js-tooltip-container')) containers.forEach(container =>new Tooltip(container))
from tooltips
class Tooltip { constructor(tooltip) { this.self = tooltip; const openers = Array.from(document.getElementsByClassName('js-tooltip-opener')) this.opener = openers.filter((opener) => opener.getAttribute(`[aria-controls="${this.self.id}"]`))[0]; } } const tooltips = Array.from(document.getElementsByClassName('js-tooltip')) tooltips.forEach(tooltip =>new Tooltip(tooltip))
from tooltips 2
class Tooltip { constructor(tooltip) { this.self = tooltip; this.opener = document.querySelector(`[aria-controls="${this.self.id}"]`)[0]; } } const tooltips = Array.from(document.getElementsByClassName('js-tooltip')) tooltips.forEach(tooltip =>new Tooltip(tooltip))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
container from
from tooltips
from tooltips 2
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Find vs select
Updated 4/2018: Vanilla vs jQuery vs Zepto vs Umbrella vs Bliss JS Library Speed Test
Vanilla vs Cash vs Bliss vs jQuery JS Library Speed Test
Vanilla vs Cash vs Bliss vs jQuery JS Library Speed Test (2021.07.20)
addEventListener() vs jQuery.on() with mouseEnter
Comments
Confirm delete:
Do you really want to delete benchmark?