HTML Elements Forums ComboBox Selected by default

This topic contains 2 replies, has 2 voices, and was last updated by  Anonymous 10 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #99439

    Anonymous

    Hi, can you please tell me how I can select a particular item by default? It is using a property or a method?

    Best regards,
    Mike

    #99443

    Anonymous

    Hi Michael20,

    You can select an item in several ways:

    • If you are initializing items declaratively inside your web page, you can set the selected attribute to the desired List Item element.
    • By setting the selectedIndexes or selectedValues properties to the correposnding value.
    • By calling the select method. This method accepts one argument – a List Item element instnace. You can get a reference to it by calling the getter items on the Combo Box element and filter out the item you desire.

    Best Regards,
    Christopher

    Smart HTML Elements Team
    https://www.htmlelements.com

    #99448

    Anonymous

    This really helps, thanks.

    Best regards,
    Mike

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.