All,

I'm trying to write a simple function to take a DOM element like so:

<div id="test" data-label="some label" data-width="400" 
data-layer_opts-test="layered option"/>

and turn it into:

{
  label: "some label",
  width: "400",
  layerOpts: {
    test: "layered option"
  }
}

The function I wrote here: http://jsfiddle.net/P89GG/ works but i was 
wondering if there was a more efficient (or just plain better) way of doing 
this. 

Any and all suggestions are welcomed.

Thanks,
Jon

Reply via email to