Inline writing js will be rejected?

Hi everyone, I have a question and hope everyone can answer it for me,
My question is:
if it is CSS it will be rejected. But if you write js in the same html file, what is wrong?
For example:
< script>
alert (“hello”); </ script>
or
< button onclick = “alert (‘hello’)”> Click on Me </ button>

Inline writing js will be rejected?

It depends on necessity but author should to avoid inline scripts code. In most cases for using inline scripts code author will receive soft rejection instead of hard rejection if the item quality is okay for envato market. and in soft rejection reviewer will ask to avoid inline scripts code.

Thank you for your opinion