How to implement “select all” check box in HTML?

前端 未结 29 2532
悲哀的现实
悲哀的现实 2020-11-22 11:09

I have an HTML page with multiple checkboxes.

I need one more checkbox by the name \"select all\". When I select this checkbox all checkboxes in the HTML page must b

29条回答
  •  盖世英雄少女心
    2020-11-22 11:48

    Here is a backbone.js implementation:

    events: {
        "click #toggleChecked" : "toggleChecked"
    },
    toggleChecked: function(event) {
    
        var checkboxes = document.getElementsByName('options');
        for(var i=0; i

提交回复
热议问题