Finding Inputs without labels

Viewed 42

how can I find an input without labels?

--------------------------------------------------
  radio:

  Name "":
  <input
    class="M8E MIw e43 xpn ac9 BG7"
    id="not-blocked"
    name="not-blocked"
    type="radio"
    value="not-blocked"
  />

  Name "":
  <input
    class="M8E MIw e43 xpn ac9 BG7"
    id="blocked"
    name="blocked"
    type="radio"
    value="blocked"
  />

I tried container.querySelector('input')[0] but that fails. I can't add labels directly to the radiobutton because of styling reasons

1 Answers

querySelector is used for CSS tags.

Use getElementsByTagName instead.

Related