Can I use inline HTML in a script as below by using a library like jsx:
You can have a look at documentation: in-browser JSX transform, and also see Babel documentation
You can achieve what you want, but it is discouraged in production...