A team that I am working on has gotten into the habit of using tags in random places in the body of our HTML pages. For example:
I had not seen this before. It seems to work in the few browsers that I've tested. But as far as I know, it's not valid to put script tags in places like this.
It's valid, but not a good (or recommended) practice.
Am I wrong? How bad is it that we are putting script tags within div tags like this? Are there any browser compatibility issues I should be aware of?
There's no problem placing a under any other elements (but it should be inside or ). There's also no issue in terms of browser compatibility, however, embedding JS scripts on web pages presents serious disadvantages (how/why they are considered bad):