Your first line works for me when I type it in the console of Chrome:
jQuery('#post_status option[value="draft"]').text('Approve');
so I assume your problem may be that the element you want might not be loaded yet from where you run your script. Try wrapping it in this:
jQuery(document).ready(function() {
(function ($) {
$('#post_status option[value="draft"]').text('Approve');
})(jQuery);
});
Related Posts:
- How to block action if post is “dirty”?
- 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
- jQuery set checkbox checked
- JavaScript runtime error: ‘$’ is undefined
- How to Show External website inside another page without iFrame? [closed]
- How to get client’s IP address using JavaScript?
- Calling a user defined function in jQuery
- Simple throttle in JavaScript
- How to remove css property in jQuery
- Validate form before submit jquery
- How to get a value of an element by name instead of ID
- jquery clear input default value
- How to manage ajax calls and JSON in wordpress
- Display Media Uploader in Own Plugin on WordPress 3.5
- How to add a ” waiting” icon for an ajax in WP frontend?
- Make jQuery library load before plugin files
- What is the simplest ajax upload plugin or script to be used with wordpress?
- RequireJS in custom theme. Working Example
- How to handle multiple instance of “send_to_editor” js function
- call shortcode in javascript
- inject js after redirect
- Fire jQuery function when post edit screen loads
- wp_enqueuescript won’t load in footer even with true value set?
- jQuery Ajax() doesn’t work when the page is accessed as a WordPress template page
- modifying a template and adding jQuery to it
- Add colorpicker to featured image
- How do I pass WordPress’s get_bloginfo(‘siteurl’) to Jquery?
- How to force jQuery to load as a first script in header in frontend?
- jQuery breaking my wordpress site
- wp_verify_nonce not working
- Passing JSON-encoded HTML from WordPress to JavaScript
- Tags in WordPress 3.2
- Populating autocomplete field with custom post type
- Not sure why wp_ajax isn’t working?
- Load created php file data via ajax
- Is it necessary to enqueue jquery?
- How I got jQuery Quicksand working with WordPress?
- Displaying div from custom-post-type in Fancy Box
- NextGen plugin check failing, why?
- Return an array from get_terms and store as JavaScript array for search autocomplete
- On screen music/audio player that grabs track URL [closed]
- WP http XML response HTML encoding and image display problems
- Using WP_Query to grab custom meta values, foreach to json object
- Do we have to santise html passing into Javascript ? How?
- jShowOff not showing numeric links, shows ‘undefined’ instead
- Javascript stopped working [closed]
- Show user info in a hovercard [closed]
- Why should I deregister jquery?
- Prevent other versions of jquery from loading on static front page
- How to add custon UI jquery & Fancybox script to WP
- jQuery will not work on page from snippet or file
- Jquery not loaded by default in wordpress 5.6
- problem with jquery 3.5.1 in footer
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Accessing javascript in multiple files [closed]
- Loading jquery locally
- Issues loading Jquery on WordPress website
- Script not loading when depending on jQuery
- masonry only works if jquery is called twice
- No Object Properties sending form through AJAX
- Redirect wp_dropdown_pages() to an AJax request?
- click event to unhide something after ajax not firing
- how to use wp_editor() here am getting empty result
- jQuery is not defined, working on local server but not online
- Parse wordpress blog data using json api and ajax
- JQuery Issues With WordPress Theme Interface
- problems with jquery external rss feed integration
- wp_enqueue_script calling jQuery at different times for different browsers?
- AJAX calendar navigation returns -1
- A carousel slideshow plugin in JavaScript
- Retrive username of the loged in user using jquery
- How to setup multi-page using jquery?
- $ not defined using jQuery in WordPress
- Get with jQuery the value of an ACF field
- I want to run Sql Query in script how can i do this
- error: n.imagesLoaded is not a function
- WordPress forbidden 403 on delete in production vs local environment
- How to change event in slider
- Get ajaxForm response value
- Update a parent theme JQuery property in the child theme
- Adding scripts before plugins scripts
- jQuery search function not running in WordPress but running locally (fiddle)
- Can’t seem to get JQuery working (wordpress plugin)
- jQuery infinite scroll and pagination styling in wordpress
- Is it necessary to use a WordPress nonce when allowing users to download public data?
- Jquery is not working in wordpress php file
- wp_signon not working fine and 302 moved temporarily?
- how to refresh index page without reloading browser using ajax
- jQuery form plugin, submit in the wordpress way
- How jQuery Works in WordPress [duplicate]
- Using WP Ajax and jQuery to process multiple forms on the same page?
- jQuery cycle and WordPress: Captions, buttons, oh my
- CF7 Add a read only attribute to an input field
- Contact Form 7 checkbox to add a new class to a div [closed]
- How do I add Javascript and CSS files into WordPress?
- Why is jQuery not working properly? [closed]
- How to Javascript/jQuery
- slider wont load unless you scrolldown on mobile, slick.js carousel
- Can’t Get jQuery AutoComplete to work in WordPress (jQuery Hide/show works)