HTML and JavaScript auto increment number

前端 未结 6 1859
逝去的感伤
逝去的感伤 2020-12-30 17:04

I am new to HTML and JavaScript. I got a problem like this in HTML (This code below only visualize the problem for you to easy to reference.)


             


        
6条回答
  •  粉色の甜心
    2020-12-30 17:41

    This should work for you:

    Harry
    Simon
    Maria
    Victory

    The script should be placed immediately after your table. It goes through each row of your table and adds an extra cell to the beginning with the incrementing number inside that cell.

    JSFiddle Demo

提交回复
热议问题