从 html 标签打印 属性
Printing a property from html tag
假设你有这样的东西:
<input id="state" type="radio" name=${this.group} .checked=${this.checked} />
(来自 LitElement Dot with HTML elements attribute/property 的代码,因为我正在研究点的含义)
是否可以打印出 ${this.checked}
是什么?如果是,怎么做?
澄清:是否可以从其他文件打印出来?
如果你想要 id,它会像 this.input.getAttribute('id'),但是对于 .checked
您尝试过在要显示的地方使用 ${this.checked}
吗?
<input id="state" type="radio" name=${this.group} .checked=${this.checked} />
(checked: ${this.checked})
假设你有这样的东西:
<input id="state" type="radio" name=${this.group} .checked=${this.checked} />
(来自 LitElement Dot with HTML elements attribute/property 的代码,因为我正在研究点的含义)
是否可以打印出 ${this.checked}
是什么?如果是,怎么做?
澄清:是否可以从其他文件打印出来?
如果你想要 id,它会像 this.input.getAttribute('id'),但是对于 .checked
您尝试过在要显示的地方使用 ${this.checked}
吗?
<input id="state" type="radio" name=${this.group} .checked=${this.checked} />
(checked: ${this.checked})