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 4577776
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:23:36+00:00 2026-05-21T20:23:36+00:00

If you removeProp on something you should have used removeAttr() on will it silently

  • 0

If you removeProp on something you should have used removeAttr() on will it silently fail? Will it work? Will it actually remove the entire attribute or just the value inside it?

If checked is added using removeProp(), can it be removed with removeAttr()?

Many questions!

  • 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-05-21T20:23:37+00:00Added an answer on May 21, 2026 at 8:23 pm

    An attribute of an element is something like ‘class’. Whereas its property would be ‘className’.

    This is the reason for adding jQuery.prop and jQuery.propHooks into version 1.6, to make it easier working with both.

    So if the the property had the same name as the attribute you could use both removeProp or removeAttr.

    I asked a similar question on jQuery forum, got this answer:

    Yes, attr is meant for html attributes
    as they are strictly defined. prop is
    for properties. So for instance, say
    you have a node elem with class
    “something” (raw element not jQuery
    object). elem.className is the
    property, but is where the
    attribute resides. Changing the class
    attribute also changes the property
    automatically and vise versa.
    Currently, attr is jumbled and
    confusing because it has tried to the
    job of both functions and there are
    many bugs because of that. The
    introduction of jQuery.fn.prop will
    solve several blockers, separate code
    as it should have been separated from
    the beginning, and give developers
    faster functions to do what they
    expect them to do. Let me make up a
    percentage for a sec and say that from
    my experience in the support IRC and
    reading other’s code, 95% of the use
    cases for attr will not have to switch
    to prop.

    EDIT

    It may be best to stick to using either jQuery.attr or jQuery.prop. Theres seems to be some strange behaviour when setting and removing the checked attribute using both.

    See here for an example: http://jsfiddle.net/tomgrohl/uTCJF/

    There is a bug in 1.6 to do with selected: http://bugs.jquery.com/ticket/9079

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the jQuery documentation, it says Do not use removeProp to remove native properties
I have a JTable with some information in it. Now I want remove a
How can I remove a list of selected items in the QListView in QT
I need to translate the following Code to an Expression and I will explain
I have a table row that needs to be hidden when the anchor with
I have this JavaScript that adds a form field, along with a link to
I have a QStandardItemModel with several 100,000 records of data, and a QSortFilterProxyModel on
I have a GridView in which each row has a custom view. The grid
I have a parent w/ a popup child. When parent loads, I have to
I have a fairly simple order creation form on a back office app I'm

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.