Does anyone know how to get regular html to work inside .js file?

The reason is I made a widget I want others to use, but I don't know how to convert to .js. Is there a simple way to convert it, or does it completely have to be rewritten?