Ad
  • Default User Avatar

    Hey,

    I got this issue :
    TypeError: Cannot read property 'focus' of null
    function selectText() {
    const input = document.getElementById('input-name');
    input.focus();
    console.log(input);
    input.setSelectionRange(0,10000);
    }

    At this test : handles click and change events properly

    the thing is my code runs perfectly on CodeSandbox

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution