blob: a3fffeb83af66a2c8c70d4609e6010f9e6416ae6 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>required attribute presence test</title>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<input id="input" name="victim" required />
<textarea id="textarea" name="victim" required></textarea>
<select id="select" name="victim" required>
<option value="" selected />
<option value="X">X</option>
</select>
<script language="JavaScript" type="text/javascript">
function requiredFor(id) {
return document.getElementById(id).required;
}
description("There are three form control elements below, all required.");
v = document.getElementsByName("victim");
shouldBeTrue('requiredFor("input")');
shouldBeTrue('requiredFor("textarea")');
shouldBeTrue('requiredFor("select")');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>