document.write with user input can allow script injection.
Avoid document.write; use DOM manipulation methods instead.