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

  • Home
  • SEARCH
  • 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 8765405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:16:19+00:00 2026-06-13T16:16:19+00:00

I always try to do this $(input[name=button]).attr(disabled, ”); and it doesn’t work. Why does

  • 0

I always try to do this $("input[name=button]").attr("disabled", ''); and it doesn’t work. Why does this not work?

I ended up using this $("input[name=button]").attr("disabled", false);. Seems to me that both are equivalent.

  • 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-13T16:16:20+00:00Added an answer on June 13, 2026 at 4:16 pm

    Why does this not work?

    disabled is a so called boolean attribute:

    A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

    If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace.

    So an empty value still indicates the presence of the attribute and therefore the form element stays disabled.


    Seems to me that both are equivalent.

    They are not. jQuery treats boolean attributes differently. It tests the value of the new, uhm, value, and removes the attribute if the value is false:

    set: function( elem, value, name ) {
        var propName;
        if ( value === false ) {
            // Remove boolean attributes when set to false
            jQuery.removeAttr( elem, name );
        } else {
            // ...
        }
        return name;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try build a php regex that validate this type of input string: {name:'something
this error is always fired, when i'm try to free my allocated struct the
I have some html like this <form id=reportform method='post'> <input type='hidden' id='qid' name='qid' value=<?php
I have a lot of rows like this: <input id=car_ids_ name=car_ids[] value=142 type=checkbox> Car
Whenever I use WCF, I always try to make immutable classes that end up
When I try to initialize an object using the Object Initializer, ReSharper always inserts
When I try to do the select statement, I always get the following error:
When I try to create the a table the very first time, I always
Whenever I try to open .pyc or .pyo files, I always get an error
Good day, I try to start new Activity from another. But it always crashed.

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.