What does this validation error mean:

end tag for “script” omitted, but OMITTAG NO was specified
You may have neglected to close an element, or perhaps you meant to “self-close” an element, that is, ending it with “/>” instead of “>”.



on this page.

What it is saying is that the validator got confused with the script in the middle of the page and could no longer tell what was HTML and what was JavaScript.

You really ought to escape yout closing HTML tags inside of the JavaScript so that the JavaScript itself doesn’t interpret them as the end of the script

Never use </ anywhere in JavaScript - use <\/ instead.

do you mean to say even if I have a <a> in javascript I would want to close it with <\/a> and not </a>?

Depending on the browser and </ found could be interpreted by JavaScript as being the end of the script and so ALL should be escaped.

The better alternative is to use the proper JavaScript for creating the tags that creates both the open and closing tags together and which doesn’t need the < / or > to be specified at all (eg using createElement(‘a’) to create <a></a> to add to the HTML and the appropriate JavaScript DOM commands to create the rest as well).