---
title: Matrix with Checkboxes
product: Form Library
description: This demo illustrates how to add a matrix table to a SurveyJS form and set its cell type to checkboxes.
framework: jQuery
source: https://surveyjs.io/form-library/examples/checkbox-matrix-question/jquery
index: https://surveyjs.io/form-library/examples/overview.md
---

# Matrix with Checkboxes (jQuery)

A matrix with checkboxes allows respondents to select more than one option per row. These options often represent multiple applicable attributes, preferences, or conditions. To create a matrix with checkboxes, first create and configure a matrix with radio buttons ([Single-Select Matrix](/form-library/examples/single-selection-matrix-table-question/)) and then set its [`cellType`](/form-library/documentation/api-reference/matrix-table-question-model#cellType) property to `"checkbox"`.

## Files

### `public/index.html`

```html
<div id="surveyElement" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-height: 100%; height:100%"></div>
```

### `src/index.css`

```css
/* You can add your custom CSS here. */
```

### `src/index.js`

```js
import $ from "jquery";
import { Model } from "survey-core";
import "survey-js-ui";
import "survey-core/survey-core.min.css";
import "./index.css";
import { json } from "./json";

const survey = new Model(json);
survey.onComplete.add((sender, options) => {
    console.log(JSON.stringify(sender.data, null, 3));
});

$("#surveyElement").Survey({ model: survey });
```

### `src/json.js`

```js
export const json = {
  "elements": [
    {
      "type": "matrix",
      "name": "device-usage",
      "cellType": "checkbox",
      "title": "Which devices do you use for each of the following activities?",
      "columns": [
        { "value": "phone", "text": "Phone" },
        { "value": "tablet", "text": "Tablet" },
        { "value": "laptop", "text": "Laptop" },
        { "value": "smart-tv", "text": "Smart TV" }
      ],
      "rows": [
        { "value": "videos", "text": "Watching videos" },
        { "value": "news", "text": "Reading news" },
        { "value": "calls", "text": "Video calls" },
        { "value": "shopping", "text": "Online shopping" }
      ]
    }
  ]
};
```

### `src/theme.js`

```js
export const themeJson = {};
```

### `package.json`

```json
{
  "dependencies": {
    "jquery": "latest",
    "survey-core": "latest",
    "survey-js-ui": "latest"
  }
}
```

## Other Frameworks

- [Angular](https://surveyjs.io/form-library/examples/checkbox-matrix-question/angular.md)
- [React](https://surveyjs.io/form-library/examples/checkbox-matrix-question/reactjs.md)
- [Vue 3](https://surveyjs.io/form-library/examples/checkbox-matrix-question/vue3js.md)
- [Vanilla JS](https://surveyjs.io/form-library/examples/checkbox-matrix-question/vanillajs.md)
