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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:10:48+00:00 2026-06-05T19:10:48+00:00

My problem is very simple $(‘#button’).removeAttr(‘type’); triggers an error on firebug type property can’t

  • 0

My problem is very simple

$('#button').removeAttr('type');

triggers an error on firebug

type property can't be changed

I have 2 questions:

  • How to get around this?
  • Is there a reference with a list of properties that can’t be changed?

Thanks

EDIT

What I want to do is:

Prevent the button from submitting the form.

Note: my button is included as a html template, the form code is not accessible form me.
Something like:

include 'form.php';
include 'buttons.php';

where I have control only on buttons.php

  • 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-05T19:10:49+00:00Added an answer on June 5, 2026 at 7:10 pm

    You can’t change an input‘s type in IE (<9?) after it has been inserted into the DOM. jQuery raises an error for all browsers because of this.

    From source:

        set: function( elem, value ) {
                // We can't allow the type property to be changed (since it causes problems in IE)
                if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
                    jQuery.error( "type property can't be changed" );
    

    There are no other cases I know about (or jQuery knows about) and how to get around this depends a lot on what you are trying to do in the first place. Consider creating a new element with different type and using that for example.

    Edit: To prevent the button from submitting a form, you can use:

    $("#button").click(function(e){
        e.preventDefault();
    });
    

    Or (credit Tim Down):

    $("#button").prop("disabled", true);
    

    To prevent form from being submitted through any means, you can use:

    $("#form").submit(function(e){
        e.preventDefault();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple problem, but I can't seem to solve it. I
I have a very simple problem, but I just can't figure it out. My
I have very simple problem that I can't solve. I need to do something
actually I'm have a very simple problem (that's for sure) I just can't find
very simple problem here... but I can't work it out. I have a simple
I have a big problem with very simple code. I need to get a
I have a very simple problem but cannot find a nice solution. I have
I have a very simple problem. I have a data frame with multiple rows
Very simple problem, but can't seem to solve it. I'm probably just not thinking
I have a very simple problem in which I need to do something after

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.