715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

Hi,

Here’s a simple question. I have a checkbox, so as we all know, when you click on it, it is checked.

Here’s the thing, when you check it, it doesn’t update the DOM , you can see that it’s checked, but not in the DOM . So I tried to add the attribute “checked = checked” to the element via JS, but it doesn’t change a bit.

Anyone else has saw this “issue”? I need the checked attribute for further processing since I’m taking the innerHTML of the parent to put it into another “div” after a click event.

Thanks!

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

can you submit a snippet to jsfiddle?

715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

yeah sure: jsfiddle

126 posts
  • Has been part of the Envato Community for over 2 years
  • Has sold $100+ on Envato Market
  • Sells items exclusively on Envato Market
  • Located in United Kingdom
matt5409 says

I’m not sure I understand… if you’re posting it to another page, the value is passed on submit. Alternatively if you need it to affect the DOM , just use JS. Something like http://forum.jquery.com/topic/jquery-checkbox-checked-event ?

715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

The DOM needs to be changed when you check the checkbox. I’m trying it to do it with JS, but it doesn’t change a bit in the DOM .

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

Don’t get it. With jQuery everything seems normal: http://jsfiddle.net/zaSVH/1/

715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

check the checkbox and inspect the element, you’ll see that the attribute “checked” isn’t there but the checkbox is checked.

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

I guess because “checked” is not an attribute rather a property. You write checked="checked" because of a valid XHTML syntax. HTML don’t need that so checked is good.

readonly, disabled or required are also properties and not attributes

Edit: properties can only be true or false not something like “checked”

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says

What is the value of an input that is checked and not checked?

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by