Select size attribute

Definition and Usage

size Attribute to set or return the size of the dropdown list Size attribute Value.

The size attribute specifies the number of visible options in the dropdown list.

Note:In Chrome and Safari, the size attribute may not work properly for size="2" and size="3".

See also:

HTML Reference Manual:HTML <select> size پرزنٹیشن

HTML Reference Manual:HTML <select> ٹیگ

Example

Example 1

Change the number of visible options in the dropdown list:

document.getElementById("mySelect").size = "4";

Try it yourself

Example 2

Return the number of visible options in the dropdown list:

var x = document.getElementById("mySelect").size;

Try it yourself

Syntax

Return size attribute:

selectObject.size

set size attribute:

selectObject.size = نمبر

عوامل کا ارزش

مقدار وصف
نمبر

فائل میں دیکھائی جانے والی آپشنوں کی تعداد کو مقرر کرتا ہے۔

اگر اس کا مرتبہ 1 سے زیادہ ہے، لیکن فائل میں آپشنوں کی تعداد سے کم ہے تو براوزر اس میں سکرول بار کا استعمال کریگا، جس سے وضاحت ہوجائے کہ مزید آپشن دیکھنے کیلئے مزید آپشن ہیں۔

تکنیکی تفصیلات

بازگشت ارزش: عدد، اس فائل میں دیکھائی جانے والی آپشنوں کی تعداد کو ظاہر کرتا ہے۔

بھرپائی کا معاملہ

کروم ایج فائر فاکس سافری آپریا
کروم ایج فائر فاکس سافری آپریا
مقابلت مقابلت مقابلت مقابلت مقابلت