Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8524059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:35:03+00:00 2026-06-11T07:35:03+00:00

Currently in our plugin we were setting the checkboxes as checked by setting <input

  • 0

Currently in our plugin we were setting the checkboxes as checked by setting

<input type="checkbox" checked="checked" />

This was to preserve xhtml compatibility. I’m more used to setting checked as a property

<input type="checkbox" checked />

What is the correct way to proceed in html5?Should we still care about xhtml compatibility?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:35:04+00:00Added an answer on June 11, 2026 at 7:35 am

    It is an attribute in either case. And it sets a value (the same value, true) on a DOM property of the element node in either case.

    For most purposes, it does not matter which syntax you use. However, there are some points to note:

    • If you use HTML5 in XML serialization (“XHTML5”), you must use checked="checked".
    • In styling, the syntaxes are not quite equivalent when using attribute selectors (the shorter form does not match [checked=checked]), but this does not matter in practice: [checked] matches checked checkboxes in either case.
    • The clumsy syntax checked="checked" is a holdover from SGML and included for compatibility only, so it may make your code look old-fashioned (which rarely matters).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently our dev team uses this pattern, but I can't help but wonder if
We are currently using the struts2-jquery plugin in our web-application. The plugin works great
I am currently running mysqldump on a Mysql slave to backup our database. This
We are currently in the process of setting up CI for our rails application.
At our enterprise we have an ActiveX plugin in IE that is currently disabled
Our team is sharing a Jenkins server with other teams, and this currently means
I'm currently writing a plugin for our integration server that uses libxml2's xmllint command
Currently our website uses links to allow the user to change their locale. The
Currently our queries add a variety of Restrictions to ensure the results are considered
Currently our code uses a for-loop for filling a buffer holding a Unicode string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.