Black Lives Matter. Please consider donating to Black Girls Code today.

Accessing layers

I am using the following code:
var layer = div_chart.getElementsByClassName(‘nsewdrag’)[i];
if (layer.dataset.subplot) …

to find a layer that represents a specific subplot, something like “x2y2”. Works fine in chrome, but IE has no dataset. How else can I find a specific layer?

Thanks

This could be related: https://stackoverflow.com/questions/6584635/getelementsbyclassname-doesnt-work-in-old-internet-explorers-like-ie6-ie7-i

The question is about layer.dataset.subplot. Dataset doesn’t exist in IE11.