If I am understanding correctly, you wish to iterate over the possible values for a css property. Unfortunately, there is no way to do this. What you could do is store the possible values so that when you need to list them, you can just look them up. Take the following example.
var cssProperties = { position: ['inherit', 'static', 'relative', 'absolute', 'sticky', 'fixed'], float: ['inherit', 'left', 'right', 'none'] };
function lookupCssValues(property) {
return cssProperties[property];
}
You can traverse the possible css properties for an element by doing something like this:
for(var property in element.style) {
if(typeof elem.style[property] === 'string') {
console.log(property) // this is a css property for the element
}
}
document.getElementById('your element').stylereturns all of your current styles to that particular element..