javascript - Difference between setAttribute and setAttributeNS(null, -


what difference between calling setattribute , setattributens null namespace parameter?

also there issue using getattribute() , setattributens ?

setattribute() dom 1 function. setattributens() dom 2 function resolves problem of conflicting tag or attribute names specifying xmlns namespace should apply tag/attribute in first argument.

if attribute not have defined namespace prefix, first argument must null. use setattribute() consistency advisable stick setattributens(). see:

https://developer.mozilla.org/en/docs/web/svg/namespaces_crash_course#scripting_in_namespaced_xml

"however, note carefully: namespaces in xml 1.1 recommendation states namespace name attributes without prefix not have value. in other words, although attributes belong namespace of tag, not use tag's namespace name. instead, must use null namespace name unqualified (prefixless) attributes."


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -