Call by value in javascript not working

The Ajax first code where we use value instead of innerHTML to give an alert of the text that is submitted by the user it gives me an error saying"Uncaught TypeError: Cannot read property ‘value’ of null, at update_user, at HTMLButtonElement.onclick .
It is showing me the submit button but when I click it no alert is given.

Paste your script here.


Correction - var user_number = document.getElementById(“user_name”).value;

user_number --> user_name

insert var before user_number

Move ‘}’ 1 tab to the right. Under ‘f’ of function.

1 Like

@akshayan.sinha Thanks a lot for your help. It’s working now.

1 Like