<html>

<head>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
	<script>
		$(document).ready(function() {
			$("#btn").click(function() {
				console.log("iam in function");
				var number = $("#num").val();
				console.log("selcet number" + number);

				//var output = "";
				if (number == 1) {
					output = "Sunday"
				} else if (number == 2) {
					output = "Monday"
				} else if (number == 3) {
					output = "Tuesday"
				} else if (number == 4) {
					output = "Wednesday"
				} else if (number == 5) {
					output = "Thursday"
				} else if (number == 6) {
					output = "Friday"
				} else if (number == 7) {
					output = "Saturday"
				} else {
					output = "Not a weekday"
				}
				$("#result").html(output);
			});
		});
	</script>
</head>

<body>
	Enter a number:
	<input type="text" name="value" id="num"></input>
	<button id="btn"> Submit </button>
	<p id="result"> </p>
</body>

</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.