I need to be able to insert the data attribute name in HTML. I want to pull the data-name out from the example below and insert it in HTML. If there is a way to get rid of data-, that would be great too.
not 100% clear on what exactly you want, im interpreting it as you want to basically get all of the attributes in the li element and insert both the value of the attribute and the name of the attribute into the body of the element.
ie your example above becomes