# Has createCheckbox() always made a checkbox with a div or is it a bug?

**URL:** <https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610>\
**Category:** p5.js\
**Created:** [October 14, 2020, 11:27pm UTC](https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610 "2020-10-14T23:27:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![toad](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@toad](https://discourse.processing.org/u/toad)\
**Post date:** [October 14, 2020, 11:27pm UTC](https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610/1 "2020-10-14T23:27:52Z")

</div>

i have a for loop that creates 20 checkboxes, however they are all in there own individual divs, which makes them all display: block which is not what i want.

any suggestions?

---

<div class="post-metadata">

**Author:** ![stixan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stixan/32/21628_2.png) [@stixan](https://discourse.processing.org/u/stixan)\
**Post date:** [September 17, 2021, 3:04pm UTC](https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610/2 "2021-09-17T15:04:25Z")

</div>

Commenting to bump this question to the front page. I too get an additional (unwanted) div around checkboxes created using the createCheckBox(). Sure, I could fix it with a splash of CSS but it seems to be a bug in p5 and it’s driving me crazy. Help!

Using p5.js ver 1.4.0.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 18, 2021, 6:20am UTC](https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610/3 "2021-09-18T06:20:33Z")

</div>

@stixan – did you report it as an issue on the p5.js github repository?

---

<div class="post-metadata">

**Author:** ![stixan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stixan/32/21628_2.png) [@stixan](https://discourse.processing.org/u/stixan)\
**Post date:** [September 20, 2021, 7:55am UTC](https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610/4 "2021-09-20T07:55:30Z")

</div>

No. But I’ll do that now. Just wanted to probe if others still experienced this issue.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 20, 2021, 8:24am UTC](https://discourse.processing.org/t/has-createcheckbox-always-made-a-checkbox-with-a-div-or-is-it-a-bug/24610/5 "2021-09-20T08:24:11Z")

</div>

> <https://github.com/processing/p5.js/issues/5422>
>
> Using createCheckbox() without specifying a label creates an \<input\> element wra…pped in a \<div\>. By comparison, createInput() simply inserts an \<input\> element. For consistency and ease of having to style checkboxes with CSS it would be desireable if createCheckbox() with no label specified behaved like createInput().
> 
> \#### Most appropriate sub-area of p5.js?
> 
> \- \[\] Accessibility (Web Accessibility)
> \- \[\] Build tools and processes
> \- \[\] Color
> \- \[\] Core/Environment/Rendering
> \- \[\] Data
> \- \[X\] DOM
> \- \[\] Events
> \- \[\] Friendly error system
> \- \[\] Image
> \- \[\] IO (Input/Output)
> \- \[\] Localization
> \- \[\] Math
> \- \[\] Unit Testing
> \- \[\] Typography
> \- \[\] Utilities
> \- \[\] WebGL
> \- \[\] Other (specify if possible)
> 
> \#### Details about the bug:
> 
> \- p5.js version: 1.4.0
> \- Web browser and version: Google Chrome 93.0.4577.82 (Official version) (x86\_64)
> \- Operating System: MacOSX 10.14.6
> \- Steps to reproduce this:
> 
> function setup() {
> createCanvas(400, 400);
> let s = createCheckbox();
> let f = createInput();
> }
> 
> function draw() {
> }
> 
> (examine created \<input\> elements and their associated HTML code with the browser's developer inspector)
