1

I have Multi Select which I would like to append it to a div, when I append, or html it to div the CSS or js not taking effect so it show as basic multi select. but when I copy ('#table').text("...") and past it in the div it work fine. I attached image so you can take look it.

    var table = "<select id=\"s11\" class=\"s11\" multiple=\"multiple\"><option>All</option><option selected=\"selected\">Low</option><option selected=\"selected\">Medium</option><option selected=\"selected\">High</option></select>";
  $('.table').html(table);

This image when I copy the Code directly in div tag : enter image description here

This image is when I append or html to the div class: enter image description here

3
  • 1
    Please use jsfiddle.net to post samples, not screenshots. Commented Dec 15, 2015 at 2:28
  • Sorry I will go head and do It Commented Dec 15, 2015 at 2:34
  • I have hard time to add all dropdownchecklist.js in jsfiddle. Commented Dec 15, 2015 at 3:07

1 Answer 1

2

I think you are using a jQuery plugin to make a checkable selection .

For example, let says your function is dropdownchecklist():

$('select').dropdownchecklist();  // may not be exactly this method

Then you have to use the same function after adding select element:

var table = "<select id=\"s11\" class=\"s11\" multiple=\"multiple\"><option>All</option><option selected=\"selected\">Low</option><option selected=\"selected\">Medium</option><option selected=\"selected\">High</option></select>";
  $('.table').html(table);
  $('.table #s11').dropdownchecklist();
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.