# Sp-checkbox can I 'uncheck' a checked box via Javascript

**URL:** <https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440>\
**Category:** UXP Plugin API\
**Created:** [March 17, 2022, 7:27pm UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440 "2022-03-17T19:27:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mherb204](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mherb204/32/2042_2.png) [@mherb204](https://forums.creativeclouddeveloper.com/u/mherb204)\
**Post date:** [March 17, 2022, 7:27pm UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440/1 "2022-03-17T19:27:44Z")

</div>

I have a series of checkboxes that I’d like to be able to uncheck via a click event. I’ve written the function and tried a number of different methods with no success.

```auto
document.getElementById("myCheckBox").activated = false;

```

this is what I thought might work but it doesn’t. I see that in the HTML you can specify “checked” or “unchecked”.

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [March 17, 2022, 7:41pm UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440/2 "2022-03-17T19:41:26Z")

</div>

Never heard of html `activated` or `unchecked`. Where did you see those? You can have attribute `checked` set to `checked` eg., or to uncheck just remove attribute

---

<div class="post-metadata">

**Author:** ![mherb204](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mherb204/32/2042_2.png) [@mherb204](https://forums.creativeclouddeveloper.com/u/mherb204)\
**Post date:** [March 17, 2022, 8:01pm UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440/3 "2022-03-17T20:01:54Z")

</div>

what would the syntax look like? I can’t tell you where I saw the .activated. I’ve searched damn near the entire internet looking for an answer.

---

<div class="post-metadata">

**Author:** ![mherb204](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mherb204/32/2042_2.png) [@mherb204](https://forums.creativeclouddeveloper.com/u/mherb204)\
**Post date:** [March 17, 2022, 8:05pm UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440/4 "2022-03-17T20:05:10Z")

</div>

document.getElementById(“print-laser”).removeAttribute(“checked”); Thank you for the nudge. That was what I needed!!

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [March 23, 2022, 1:38am UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440/5 "2022-03-23T01:38:02Z")

</div>

This also works

`document.getElementById("myCheckBox").checked = false;`

Or to check it on

`document.getElementById("myCheckBox").checked = true;`

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [March 23, 2022, 7:21am UTC](https://forums.creativeclouddeveloper.com/t/sp-checkbox-can-i-uncheck-a-checked-box-via-javascript/4440/6 "2022-03-23T07:21:42Z")

</div>

I remember setting to `false` didn’t use to work on all browsers, but yes - that’s UXP and shouldn’t matter if it works
