How to list all element attributes in JS?

后端 未结 3 1116
孤城傲影
孤城傲影 2021-01-14 19:07

I would like to know all possible attributes of an element in JS.

I did :

s = document.getElementById(\"idSvg\");

r = s.attributes;

alert(r.length)         


        
3条回答
  •  醉酒成梦
    2021-01-14 19:45

    http://www.w3.org/TR/SVG/attindex.html

    baseProfile class contentScriptType contentStyleType externalResourcesRequired height id onabort onactivate onclick onerror onfocusin onfocusout onload onmousedown onmousemove onmouseout onmouseover onmouseup onresize onscroll onunload onzoom preserveAspectRatio requiredExtensions requiredFeatures style systemLanguage version viewBox width xml:base xml:lang xml:space x y zoomAndPan

提交回复
热议问题