How to POST HTML form using `id` instead of `name`

前端 未结 3 1482
粉色の甜心
粉色の甜心 2021-01-22 19:27

This following code will get element by name, I\'m gonna change it to get element by ID, how to make it?



        
3条回答
  •  轮回少年
    2021-01-22 19:37

    You can't do this,i've read somewhere that we can control element by only their name after HTML 4.01.

    here, previous post also support it. previous post

    But if , you really want to access it through id, then you have to use ajax call for sending data to server. In ajax call, you can access element by their Id.

提交回复
热议问题