Is it bad practice to embed JavaScript into the body of HTML?

前端 未结 17 2487
梦谈多话
梦谈多话 2020-12-13 01:44

A team that I am working on has gotten into the habit of using

17条回答
  •  眼角桃花
    2020-12-13 02:01

    It is valid!

    You can use:

    
    

    I don't think you can say if it is a bad practice in general. You have to tell in the case. But sure is that it is good to have all your JavaScript code at the same place. It's a little messy if you have little pieces of JavaScript code all over your HTML file.

提交回复
热议问题