Error message "NaN" with a factorial calculator
I'm trying to create a factorial calculator in Dreamweaver using HTML and Javascript.
I'm encountering an error when I preview the code and try to use the calculator, the error message "NaN" pops up instead of a number. I've been told the error is somwhere in this line of code;
document.getElementById('answer').innerHTML = "Your Answer Is" * a;
but I can't figure out whats wrong with it. I'm quite inexperienced with Javascript and coding so a dumbed down answer would be appreciated.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Untitled Document</title>
<link rel="stylesheet" href="factoral.css">
</head>
<body>
<h3>Enter Your Number</h3>
<input type="text" id="que">
<input type="button" value="click me" onclick="myFunction()">
<br><br>
<p id="answer"></p>
</body>
<script>
function myFunction(){
var x = document.getElementById('que').value;
var a = 1;
for (i =1; i <= x; i++){
a *= i;
console.log(a)
}
document.getElementById('answer').innerHTML = "Your Answer Is" * a;
}
</script>
</html>
