I would like to get all the elements / nodes on an HTML page containing attributes that start with something (again, attribute names start with something, not their values!). For example, TinyMCE tends to add custom attributes to the elements it stores, such as "mce_style"
, "mce_href"
, "mce_bogus"
, etc. I would like to have something like a CSS3 selector for attribute values, [attr^="mce_"]
, but not for values, attribute names .
Of course, I can iterate over all the DOM nodes and their attributes and check them one by one, but I was wondering if there is a more efficient way.
Please do not give me answers to TinyMCE, I am sure that there is a flag that would prevent TinyMCE from saving these attributes, but the question is general.
source share