Button onclick not working

When I type any number inside the input box, and click submit, no alert message pops up. Here’s my code:

<p id = "output">Enter user number </p>

<input id="user_number">

<button onlick="update_user()">Submit</button>

<script type="text/javascript">

    function update_user(){

        user_number = document.getElementById("user_number").value;




That is because you made a simple spell error, it should be ‘onclick’ instead of ‘onlick’.
Don’t worry this happens a lot XD

Goodluck with your project! :smiley:

1 Like

Thank you so much :grinning: :grinning:

1 Like