<html>

<head>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
	</script>

	<script>
		$(document).ready(function() {
			$("#answer").click(function() {
				var n = $("#number").val();

				$("#result").val((+n) * ((+n) + (1)) / (2))
			});

		});
	</script>

</head>

<body>

	<div>
		Enter your factorial number:
		<input type="text" id="number"><br><br>

		<button type="button" id="answer">Answer</button><br><br> Result:
		<input type="text" id="result">


	</div>
</body>

</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.