[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Checked property in HTML checkbox

Posted on 2006-03-27
Medium Priority
Last Modified: 2008-03-17
Hey experts,

  What's the property in HTML to set to indicate if an input of type checkbox is checked or no?
Question by:mte01
  • 2
LVL 12

Accepted Solution

jessegivy earned 1080 total points
ID: 16301895
Well there's two properties that control that.  If your talking about setting the checked status during runtime via script then you're talking about the checked property, to check all checkboxes on the page the function would look like this:

function checkAll()
   var inputs=document.getElementsByTagName("input");
   for(var i=0;i<inputs.length;i++)

...however, if you want to set the checkboxes state in the tag, it's slightly different, no need to specify boolean value just include the word checked in the tag deffinition like so:

<input type="checkbox" id="someCheckbox" name="someCheckbox" checked>



Author Comment

ID: 16301936

Yeh, I got that...thanks for your help!!
LVL 12

Expert Comment

ID: 16301991
You're most certainly welcome!  :)

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question