ড্রপডাউন লিস্টের সব অপশন দেখাতে options প্রপার্টি ব্যবহার করুন। এই প্রপার্টি আপনাকে length প্রপার্টি দিয়ে সব অপশন পেতে দেয়।
উদাহরণ
নিচের কোডটি রান করে ড্রপ-ডাউন লিস্ট থেকে সব অপশন পান।
<!DOCTYPE html> <html> <body> <form id="myForm"> <select id="selectNow"> <option>One</option> <option>Two</option> <option>Three</option> </select> <input type="button" onclick="display()" value="Click"> </form> <p>Click the button to get all the options</p> <script> function display() { var a, i, options; a = document.getElementById("selectNow"); options = ""; for (i = 0; i < a.length; i++) { options = options + "<br> " + a.options[i].text; } document.write("DropDown Options: "+options); } </script> </body> </html>