0

Say you have something like this:

<input id="state" type="radio" name=${this.group} .checked=${this.checked} />

(Code from LitElement Dot with HTML elements attribute/property as I was researching what the dot meant)

Is it possible to print out what ${this.checked} is? If so, how?

Clarification: Is it possible to print it from, for example, another file?

Like if you wanted the id, it would be something like this.input.getAttribute('id'), but for the .checked

webdesignnoob
  • 381
  • 1
  • 4
  • 13

1 Answers1

1

Did you try using ${this.checked} where you want to display it ?

<input id="state" type="radio" name=${this.group} .checked=${this.checked} />
(checked: ${this.checked})
Gabriele Petrioli
  • 191,379
  • 34
  • 261
  • 317
  • Oops, should have clarified, is it possible to print it from, for example, another file? Like if you wanted the id, it would be something like this.input.getAttribute('id'), but for the .checked – webdesignnoob Feb 11 '21 at 21:11
  • if you have a reference to the DOM element, you can do `element.checked` or `element.group` etc. – Gabriele Petrioli Feb 11 '21 at 21:27