To make a long story as short as possible (ignore this paragraph if you really just want to cut to the chase):
I'm using CuteEditor to edit very specific pages of controls. In the page viewer application these controls use HTML5 canvii to do all sorts of funky anim stuff, but in CuteEditor (where it's not practical to do the same thing) they are represented by IMG elements for editability. These controls have a bunch of properties, and this is all saved and loaded from an SQL database. Different types of control have different possible types of properties, and in CuteEditor these are stored as attributes of the element (such as PipColour="Green") I have created a custom tab for the CuteEditor IMG editor dialog, which when the control type is changed, an SQL database is called to get all the possible properties so the dialog can be populated with the relevant input controls.
Now, the chase:
In CuteEditor, custom dialog tabs use a .ascx file with SyncToView() and SyncTo(element) javascript methods to get and set the attributes of the element being edited, using
element.<attributename>
Since I don't necessarily know what attributes 'element' will have or what they will be called, is there a way to enumerate through them all by name?
You can use the following code snippet, it will give you the basic idea of getting Attributes
var element = document.getElementById("someId");
var arr = [];
for (var i=0, attrs=element.attributes, l=attrs.length; i<l; i++){
arr.push(attrs.item(i).nodeName);
values.push(attr.nodeValue);
}