Can we Make a checkboxList using jquery like we fill the options in select tag of html?

Posted by SAHIL SINGLA on Stack Overflow See other posts from Stack Overflow or by SAHIL SINGLA
Published on 2010-05-24T06:32:21Z Indexed on 2010/05/24 6:41 UTC
Read the original article Hit count: 278

Filed under:

Can we Make a checkboxList using jquery like we fill the options in select tag of html?

I am confused how to make a checkboxlist using Jquery in Html?

I have seen Method for creating option tag in select tag of HTML But I dont know how to create a checkbox list?

  $.fn.fillSelect = function(data) {
     return this.clearSelect().each(function() {
        if (this.tagName == 'SELECT') {
        var dropdownList = this;
        $.each(data, function(index, optionData) {
            var option = new Option(optionData.Text, optionData.Value);                
            if ($.browser.msie) {
                dropdownList.add(option);
            }
            else {
                dropdownList.add(option, null);
            }
        });
    }
  });
 }

any link of article that contains little bit this type?

© Stack Overflow or respective owner

Related posts about jQuery