testing html

Options

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Page</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 40px;
}
#output {
margin-top: 20px;
color: green;
}
</style>
</head>
<body>

<h1>Testing Scenario</h1>

<form id="testForm">
<label for="inputText">Enter something:</label>
<input type="text" id="inputText" name="inputText" required>
<button type="submit">Submit</button>
</form>

<div id="output"></div>

<script>
document.getElementById('testForm').addEventListener('submit', function(event) {
event.preventDefault();
const input = document.getElementById('inputText').value;
document.getElementById('output').textContent = `You entered: ${input}`;
});
</script>

</body>
</html>

Categories