Adding dropdown list on a cell

Discussion in 'JavaScript' started by frwa, Sep 18, 2012.

  1. #1
    I have a dropdown list on each cell of table row. Now what I need is dynamically add more dropdownlist on a particular cells with pressing the add button. Any code snippet to help on this? Thank you.
     
    frwa, Sep 18, 2012 IP
  2. stuklen

    stuklen Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    var element = document.createElement('h1');
    element.appendChild(document.createTextNode('Create new element in DOM'));
    
    Code (markup):
    The example above creates an <h1> element, and then adds text to it.
    The end result of that operation would be this HTML:
    <h1>Create new element in DOM</h1>

    To add to cell:
    document.getElementById('cellID').appendChild(element);
    Code (markup):
     
    stuklen, Sep 20, 2012 IP
  3. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #3
    Just inset a ul child node and then style it to position absolute . Trigger it on click and the job's done .
     
    ApocalypseXL, Sep 20, 2012 IP