latin/app/templates/LLPSI/01_Imperium_Romanum/Pensum_A.html

32 lines
764 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="la">
<head>
<meta charset="UTF-8">
<title>Familia Romana Pensum A</title>
<script type="text/javascript">
function validate() {
const forms = document.querySelectorAll('form');
const form = forms[0];
Array.from(form.elements).forEach((input) => {
console.log(input);
if (input.type=="text" && input.value != input.dataset.expected) {
input.setAttribute("style", "border-color:red");
console.log('incorrect!')
}
});
console.log('dupa');
return false;
}
</script>
</head>
<body>
<form class="Pensum_A" onsubmit="return validate();">
Nilus fluvi<input type="text" id=1 data-expected="us" size=2 required> est.<br>
<input type="submit" value="Submit">
</form>
</body>
</html>