Option defaultSelected attribute

Definition and Usage

defaultSelected attribute returns selected attribute the default value.

If the default selected option is selected, this property returns true, otherwise return false.

Note:If an option is selected by default, it is displayed first in the dropdown list.

See also:

HTML Reference Manual:HTML <option> ট্যাগ

Example

Check if the selected option is selected by default:

var x = document.getElementById("mySelect").selectedIndex;
var y = document.getElementsByTagName("option");
alert("Is " + y[x].text + " selected by default? " + y[x].defaultSelected);

স্বয়ং প্রয়াস করুন

সংজ্ঞা

optionObject.defaultSelected

প্রযুক্তিগত বিবরণ

ফলাফল বলুয়ান, যদি এই অপশনটি ডিফল্ট ভাবে সিলেক্ট করা হয়, তবে true ফিরে আসবে; না তবে false ফিরে আসবে。

ব্রাউজার সমর্থন

চ্রোম এডজ ফায়ারফক্স স্যাফারি অপেরা
চ্রোম এডজ ফায়ারফক্স স্যাফারি অপেরা
সমর্থন সমর্থন সমর্থন সমর্থন সমর্থন