I'm working on an internal site for my company and I have a snippet of code that works 100% fine indepentantly but when I try to use document.write I can get it to work. I'm pretty sure it's down to the structure of it but I'm inexperienced with JS so I'm not sure how do correctly structure it.
Here is the code I want inside of a document.write():
I missed a little from the code snipped. Here it correctly this time. As an example I have put it inside a document.write(). I know some of the characters need to be escaped, but that is where some of my trouble lies I think, whatever I try it still gives errors.