HTML Attribute name

Tags
htmlproblem
Created
Oct 5, 2018 4:32 AM
image

不同于 XML 的标准

https://www.w3.org/TR/html5/syntax.html#elements-attributes

setAttribute 是 Element 上的方法,是以 xml 的标准来执行的

// 但是 getAttribute 和 removeAttribute 都没有问题

在 js 中:

  • 选择 `[.value]` 的元素:document.querySelector('[\\.value]')
  • 创建这样的属性:innerHTML,DOMParser 解析成 html
SuperMade with Super