JS احصل على عدد عناصر مربع القائمة المنسدلة
نسخة الكود كما يلي:
<! doctype html>
<html>
<head>
<script>
وظيفة getLength ()
{
تنبيه (document.getElementById ("mySelect"). الطول) ؛ // عدد العناصر
}
</script>
</head>
<body>
<Porm>
<SELECT ID = "mySelect">
<potion> Apple </soph>
<potion> Pear </soph>
<Point> Banana </soph>
<Poort> Orange </soph>
</select>
<type type = "button" onClick = "getLength ()" value = "كم عدد الخيارات في القائمة؟">
</form>
</body>
</html>