You can’t do this with jQuery, it explicitly forbids it because IE doesn’t support it (check your console you’ll see an error.
You have to remove the input and create a new one if that’s what you’re after, for example:
$('.form').find('input:password').each(function() { $("<input type='text' />").attr({ name: this.name, value: this.value }).insertBefore(this); }).remove();
To be clear on the restriction, jQuery will not allow changing type
on a <button>
or <input>
so the behavior is cross-browser consistent (since IE doens’t allow it, they decided it’s disallowed everywhere). When trying you’ll get this error in the console:
Error: type property can’t be changed
Related Posts:
- Why use Ruby’s attr_accessor, attr_reader and attr_writer?
- How to prevent the “Confirm Form Resubmission” dialog?
- enabling right click:
- JavaScript sleep/wait before continuing [duplicate]
- JSON parsing error syntax error unexpected end of input
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- How to change CSS using jQuery?
- How to properly use jsPDF library
- Cross-Origin Read Blocking (CORB)
- How do I link a JavaScript file to a HTML file?
- How do I redirect to another webpage?
- How do I redirect to another webpage?
- Cross-Origin Read Blocking (CORB)
- jQuery append() vs appendChild()
- How to replace innerHTML of a div using jQuery?
- Uncaught ReferenceError: $ is not defined?
- Uncaught ReferenceError: jQuery is not defined [duplicate]
- What does [object Object] mean? (JavaScript)
- How do I check whether a checkbox is checked in jQuery?
- syntax error: unexpected token <
- Error OPTIONS net::ERR_CONNECTION_REFUSED
- ReferenceError: $ is not defined
- Uncaught ReferenceError: jQuery is not defined [duplicate]
- What does [object Object] mean?
- Remove class using jQuery
- How do I check whether a checkbox is checked in jQuery?
- jQuery document.createElement equivalent?
- How to make history.back() without getting a warning on the browser to reload the page?
- JQuery – $ is not defined
- jQuery $(this) keyword
- Cannot read property ‘push’ of undefined when combining arrays
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- Toggle show/hide on click with jQuery
- convert Hsl to rgb and hex
- How to set time delay in javascript
- Disable button in jQuery
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- JQuery – $ is not defined
- jQuery $(this) keyword
- Cannot read property ‘push’ of undefined when combining arrays
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Disable button in jQuery
- Automatically pausing html5 video as the ‘next’ button is pressed (javascript/ jquery)
- jQuery .on(‘change’, function() {} not triggering for dynamically created inputs
- How to create a jQuery function (a new jQuery method or plugin)?
- jQuery: Wait/Delay 1 second without executing code
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) in Bind function
- Scroll to an element with jQuery
- Download File Using JavaScript/jQuery
- How to solve ‘Redirect has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header’?
- How to wait 5 seconds with jQuery?
- Submit a form using jQuery
- How to deal with net::ERR_SSL_PROTOCOL_ERROR?
- How to Handle Button Click Events in jQuery?
- How can I scroll to an element using jQuery?
- jQuery.click() vs onClick
- jQuery setTimeout() Function [duplicate]
- jQuery Get Selected Option From Dropdown
- Disabling and enabling a html input button
- Scroll to an element with jQuery
- How to enable CORS in flask
- Download File Using JavaScript/jQuery
- Check if checkbox is checked with jQuery
- How can I refresh a page with jQuery?
- How can I refresh a page with jQuery?
- Getting Error “Form submission canceled because the form is not connected”
- How can I get the ID of an element using jQuery?
- How to add jQuery code into HTML Page
- jQuery equivalent of JavaScript’s addEventListener method
- How can I get the data-id attribute?
- document.getElementById vs jQuery $()
- Check if checkbox is checked with jQuery
- Should I use .done() and .fail() for new jQuery AJAX code instead of success and error
- Pass request headers in a jQuery AJAX GET call
- How to import jquery using ES6 syntax?
- How to filter an array/object by checking multiple values
- $.ajax – dataType
- what does jQuery data() function do
- How to show loading spinner in jQuery?
- What does jQuery.fn mean?
- Getting Error “Form submission canceled because the form is not connected”
- how to call jquery selector from outside kendo window?
- Is there a link to the “latest” jQuery library on Google APIs?
- How can I get the ID of an element using jQuery?
- What is content-type and datatype in an AJAX request?
- jQuery Selector: Id Ends With?
- Adding attribute in jQuery
- speedtest.net api
- How can I refresh a page with jQuery?
- jQuery dialog popup
- data.map is not a function
- How do you select a particular option in a SELECT element in jQuery?
- Set select option ‘selected’, by value
- Setting “checked” for a checkbox with jQuery
- Nested JSON objects – do I have to use arrays for everything?
- How to find the sum of an array of numbers
- check / uncheck checkbox using jquery?
- Change Placeholder Text using jQuery
- Adding placeholder attribute using Jquery