DOM element disappearing immediately after update

后端 未结 3 719
野性不改
野性不改 2020-12-10 09:26

I have the following javascript function that updates a text within a div when a button is clicked (using an onclick() event) It works, but it immediately changes back to th

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 10:21

    You are using input type="submit" inside Form tag , clicking this button will refresh the same page .

    try

        
    
    
    Text to Change

    or remove form tag

提交回复
热议问题