Example

input event javascript

HTML

<html>
	<head>
	</head>
	<body>
		<input placeholder="your name" name="name"/>
		<p id="nameList"></p>
		
		<script type="text/javascript" src="inputev.js"></script>
	</body>
</html>

JavaScript

// make the link to the element objects
const inputField = document.querySelector('input');
const displayAreaField = document.getElementById('nameList');
// adding the event listener for input event type
inputField.addEventListener('input', addNames);
// addNames is the function to be called
function addNames(inputevent) {
	displayAreaField.textContent = inputevent.target.value;
}