<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Detect enter in input</title>
</head>
<body>
<input type="text" id="textInput" placeholder="Press Enter...">
<script>
inputTag = document.getElementById('textInput');
inputTag.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
alert("Enter was pressd"); // Perform desired actions here
}
}
);
</script>
</body>
</html>