Uncaught TypeError: Cannot set property 'value' of null

前端 未结 8 935
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 07:58

I\'m trying to pass the entered text to the controller using an ajax request. But i\'m getting athe error \"Uncaught TypeError: Cannot set property \'value\' of null \" whe

8条回答
  •  粉色の甜心
    2020-12-05 08:44

    You don't have an element with the id u.That's why the error occurs. Note that the global variable document.getElementById("u").value means you are trying to get the value of input element with name u and its not defined in your code.

提交回复
热议问题