Web Analytics Made Easy -
StatCounter Setting multiple in select element using DOM method - CodingForum

Announcement

Collapse
No announcement yet.

Setting multiple in select element using DOM method

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting multiple in select element using DOM method

    I am trying to set the multiple property in a select element using DOM method.
    Code:
    var element = document.createElement('select')
    //But setting
    element.multiple = true
    //OR (in the case of XHTML, which I am using)
    element.multiple = 'multiple'
    Neither method of setting the property above seem to work. I don't know if I am
    actually doing something wrong.
    I do have size set to something greater than 0. I only see one option visible.

    This is new territory for me. I have always been satisfied with one selectable
    option.

    Thank you for time and attention
    JK
    Last edited by anotherJEK; Jun 2, 2020, 02:24 AM.

  • #2
    This was a rediculus exercise: I have a function that uses document.createElement and sets various properties.
    I had not added code to set multiple and size. That is why is appeared not to be working.
    Thanks for time and attention;
    JK

    Comment


    • #3
      Generally if you're generating something like that client-side in the scripting, you're doing something wrong.
      I'll kill you and your dreams tonight, begin new life.
      Bleed your death upon me, let your bloodline feed my youth.
      https://cutcodedown.com

      Comment


      • #4
        Simple question, but just checking: Are you using 'shift' or 'ctrl' when making a multiple selection?

        Comment

        Working...
        X