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 do I check whether a checkbox is checked in jQuery?
- $.ajax – dataType
- how to call jquery selector from outside kendo window?
- How to use jQuery qTip?
- jQuery $.cookie is not a function
- Setting background-image using jQuery CSS property
- jQuery disable/enable submit button
- JQuery issue “TypeError: $.getJSON is not a function”
- javascript function wait until another function to finish
- Refresh/reload the content in Div using jquery/ajax
- how to get the value of a textarea in jquery?
- Why define an anonymous function and pass it jQuery as the argument?
- How to scroll an HTML page to a given anchor
- TypeError getElementsByTagName is not a function issue
- How to check if the URL contains a given string?
- Check if url contains string with JQuery
- Check if a div exists with jquery
- $(document).ready(function() is not working
- WordPress PHP proxy/helper pages for Twitter API
- Using jQuery to delete data stored in wp_options
- Making $ globally accessible with jQuery.noConflict()
- Color Picker (iris) in widget – refresh when edited in Customizer
- Ajax call does not activate callback function
- Add `datetimepicker` to form
- How to reload a select box of posts dynamically?
- How to pass both action and formdata in wordpress ajax?
- How to load post content on index page using ajax when post title in sidebar is clicked
- Script dependencies for post.js
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- wp_enqueue_style built in styles
- Merge two separate WP menus into one in Mobile view
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Get specific image size for small viewport width
- jQuery function didn’t work in my plugin
- Using jQuery to retrieve customizer value
- WordPress ajax function parameter value not being passed
- Is it safe to include a javascript file in a template’s php file?
- Check if user is logged in when clicking certain links on certain pages
- Ajax comments not working
- Conditional Header in wordpress
- Masonry and Jetpack Infinite Scroll – overlap issue
- Dealing with a library that depends on jQuery
- Controlling Taxonomy Category listings to hide and unhide specifics
- How can I load jquery library into my dashboard widget?
- Accessing user Meta data via REST and backbone
- Custom post type – use ajax to display sub pages
- Passing a varible from jQuery to PHP
- Create shortcode to echo javascript
- Gutenberg – Title field required
- I can’t get a return value from Ajax
- WordPress AJAX return 0 – My case
- Adding a slide toggle on WordPress
- How to keep track of when a vote is cast?
- How do I make my wordpress post appear in a mouse hover preview?
- Creating a widget and missing jQuery
- How to retrieve WP_Object that is inside an array of another array
- WP Customizer: Save a control state
- JS file is not loading when i put wp_head() and wp_footer
- Why do I get jQuery reference error / undefined when changing name of plugin file?
- limit number of post for achive page
- How to prevent tabs from opening all at once
- How do I implement jPanelMenu?
- Jquery Theme Roller to WordPress
- Getting jQuery AJAX to work in WordPress (getting -1)
- Custom Jquery in admin breaks media-upload script
- Admin menu success message
- Absolute path to stylesheet_dir/images/my_img.jpg does not work?
- Which hook to use when adding ajax to viewer-facing side?
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- WordPress and Modal Popup – how to make the already loaded javascript assets available in modal?
- How do I call a value from the datase using ajax
- Dropdown Category form. Only show Sub-Categories
- how can i remove js file from my footer in wordpress
- Where to add my PHP codes for AJAX Jquery to work?
- How to use wp_ajax_set_post_thumbnail?
- Theme style overrides the plugin style
- How to reload a php script, using AJAX and jQuery
- Updating Jquery object with newly created elements after AJAX call
- How do i create a search option for pdf’s only
- Special Characters and Spaces are not transferred correctly via AJAX call.
- How to manipulate elements on the Insert Media Attachment settings popup
- Site images are fixed in front of my site content [closed]
- how to add jquery to wordpress
- Ajax not updating to database
- Not getting result using ajax on wordpress
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?
- $ not defined using jQuery in WordPress
- Combining fancybox with multiple thumbnail plugin
- Highlight posts currently being edited on multiple editor site?
- adding the full image path to a wordpress javascript file
- Add specific phrase after every product title including the discounted price? [closed]
- Ensure an external javascript file called from plugin is loaded after jquery is called
- jQuery not working for tabs shortcode [closed]
- Why my vertical tab js code is refreshing the page continuously? [closed]
- bootstrap-slider.js by seiyria not working in wordpress
- AJAX values converted to PHP Variables?
- jQuery datepicker not showing on admin menu
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php