Hello @Rut7 ,
How do you print this code? Is it with <%= xyz %>?
This will HTML encode your code, and also your variable is wrongly formatted, which should throw an error, as you need to escape double quotes.
To prevent it from escaping HTML, you need to use document.write I do not know if that work...