# \[JavaScript\]document.writeln with variable and html tags

**URL:** <https://forum.kirupa.com/t/javascript-document-writeln-with-variable-and-html-tags/200185>\
**Category:** web dev\
**Created:** [September 9, 2006, 5:39pm UTC](https://forum.kirupa.com/t/javascript-document-writeln-with-variable-and-html-tags/200185 "2006-09-09T17:39:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![head\_amp\_shoulders](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@head\_amp\_shoulders](https://forum.kirupa.com/u/head_amp_shoulders)\
**Post date:** [September 9, 2006, 5:39pm UTC](https://forum.kirupa.com/t/javascript-document-writeln-with-variable-and-html-tags/200185/1 "2006-09-09T17:39:13Z")

</div>

hi guys,

i’m experimenting with some javascript and i’ve got some problem with the document.writeln when using variable and html along with it.

here’s a sample of the script where strEmail and strName is the variable and i’m trying to align the variable output to the middle with an align html tag.

document.writeln(’\<p align=“center”\> strEmail+strName \<p\>’);

but when i save the page it just won’t display anything. it works fine when i don’t include the HTML tag into it. is there any problem with the code? thanks in advance 🙂
