I am being asked to create a table using javascript that displays simple arithmetic of a variable given to me by the user and I'm sure that my syntax is off inside of my document.write, but I'm not sure where and how. My error console says I'm missing a closing ')' at line 18 the end which is not true at all. I saw that in other cases it is frowned upon to use the document.write function for this purpose, but it's explicitly stated that I should do so as part of the requirements for the completion of this lab, so my sincere apologies for this transgression beforehand.
The code is below - Thanks in advance for any and all help:
<script>
var e1="", e2="", e3="", e4="", e5="", e6="", e7="", e8="", e9="";
e1 = prompt("Enter your first name in lower case", "");
var e1u = substr(0, 1);
e1 = e1u.toUpperCase() + e1.substr(1, e1.length-1);
e2 = prompt(e1 + ", enter an integer from 1 to 9", "");
e3 = prompt("Now enter 5 numbers delineated by a comma!", "");
e4 = prompt("Now enter 3 colors delineated by a comma!");
e5 = new date();
e6 = e3.split(',');
e7 = e4.split(',');
document.write(""Today's Date = " + e5.getMonth()+1 + "/" + e5.getDay() +
"/" + e5.getFullYear() + "\n" + "The number in e2 is " + e2 + "\n"
+ "<table><caption>Times Table for the number + e2 + "</caption>"");
for(var i=0; i<13; i++)
{
document.write(""<tr>""<td>" + e2 + "</td>" + "<td>" + i + "</td>" + "<td>" + "=" + "</td>" + "<td>" + (e2 * 1) * i + "</td>""</tr>"");
}
</script>
new Date()- javascript is case sensitive.