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: javascript - getElementsByClassName() doesn't work in old Internet Explorers like IE6, IE7, IE8 - Stack Overflow

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