admin管理员组文章数量:1200979
I create elements with the var l = document.createElement("label");
and I assign its attributes with l.setAttribute("formControlName","e");
.
The problem is that the setAttribute method puts the formControlName in lowercase letters as you can see in the image below. I work with ionic so the capital letters are needed. Does anyone see what I did wrong?
I create elements with the var l = document.createElement("label");
and I assign its attributes with l.setAttribute("formControlName","e");
.
The problem is that the setAttribute method puts the formControlName in lowercase letters as you can see in the image below. I work with ionic so the capital letters are needed. Does anyone see what I did wrong?
- 3 Possible duplicate of Camel case in HTML tag attributes and jquery - doesn't work, why? – Adelin Commented Jan 17, 2018 at 11:59
- 1 Do you have a reference for "ionic so the capital letters are needed"? I find that hard to believe. – Nickolay Commented Jan 23, 2018 at 16:37
- This is rather a requirement of Angular which is a framework below Ionic. – mvermand Commented May 8, 2020 at 7:20
1 Answer
Reset to default 28Use this instead:
l.setAttributeNS(null, "formControlName","e");
'setAttributeNS()' doesn't convert the name to lower case.
本文标签: javascriptsetAttribute makes the attribute name lowercaseStack Overflow
版权声明:本文标题:javascript - setAttribute makes the attribute name lowercase - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738544728a2096185.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论