search

Home  >  Q&A  >  body text

javascript - cannot set property "onclick" of null

As shown
The error reported is: cannot set property "onclick" of null at window.onload

大家讲道理大家讲道理2753 days ago1055

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-19 10:42:17

    The element cannot be obtained. Set id to input

    reply
    0
  • PHP中文网

    PHP中文网2017-05-19 10:42:17

    1. Please post the code next time;

    2. You are using document.getElementById(), but you didn’t give the id in your HTML structure;

    3. It is recommended to use element.getElementsByTagName(tagName)this API, this is the tag name.

    reply
    0
  • Cancelreply