HTML-এ পেজ লোড হলে কোন অপশন প্রি-সিলেক্টেড থাকবে তা নির্দিষ্ট করতে selected অ্যাট্রিবিউটটি ব্যবহার করুন। নিচের কোডটি চালিয়ে selected অ্যাট্রিবিউটের ব্যবহার দেখুন:
উদাহরণ
<!DOCTYPE html> <html> <head> <title>HTML selected attribute</title> </head> <body> <p>Here's the list of subjects. Select any one:</p> <form> <select name = "dropdown"> <option value = "Computer Architecture" selected>Computer Architecture</option> <option value = "Java">Java</option> <option value = "Discrete Mathematics">Discrete Mathematics</option> </select> </form> </body> </html>