Try this code:
// Conditionally show price
(function ($) {
window.onload = function() {
if ($("#select_price_option").val() == "I need more information") {
$('#price_input_div').hide();
}
$("#select_price_option").change(function() {
if ($(this).val() == "I need more information") {
$('#price_input_div').hide();
} else {
$('#price_input_div').show();
}
});
}})(jQuery);
Related Posts:
- How do I link a JavaScript file to a HTML file?
- JavaScript runtime error: ‘$’ is undefined
- JavaScript Loading Screen while page loads
- How to make a simple image upload using Javascript/HTML
- How to call a webservice method from an html page [javascript] with out refresh the page
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- jQuery UI Datepicker not working
- Getting click on item to open closest relevant element (popup) with jQuery
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Site images are fixed in front of my site content [closed]
- ReferenceError: $ is not defined
- How to set time delay in javascript
- jQuery.click() vs onClick
- Check if checkbox is checked with jQuery
- Change Background color (css property) using Jquery
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- JavaScript: filter() for Objects
- Get class name using jQuery
- Use images like checkboxes
- Force a default browser on my android phone using a simple html shortcut page
- How to convert selected HTML to Json?
- How to Open New window on every Click
- How to make html table vertically scrollable
- How to move an element after another element using JS or jquery?
- Why is the jquery script not working?
- How to Show External website inside another page without iFrame? [closed]
- How to get client’s IP address using JavaScript?
- Simple throttle in JavaScript
- Print the contents of a DIV
- Enable & Disable a Div and its elements in Javascript
- Embedding instagram webpage inside an iframe
- Set value to currency in
- HTML Entity Decode
- Highlight a word with jQuery
- How do I refresh a DIV content?
- Javascript : array.length returns undefined
- The ‘describe’ keyword in javascript
- jQuery sort elements using data id
- getContext is not a function
- Closing Bootstrap modal onclick
- Fire oninput event with jQuery
- How do I remove a box-shadow effect from an element when another element is hovered?
- How to set “style=display:none;” using jQuery’s attr method?
- Add tinymce buttons to caption textarea in media uploader
- How to prevent wordpress from loading old versions of jquery in wp_head();?
- Move WordPress native javascript to bottom of page?
- RequireJS in custom theme. Working Example
- How to handle multiple instance of “send_to_editor” js function
- Trying to get single posts to load on the front page via ajax
- Ajax not firing properly using Firefox, but works in Chrome
- wp_enqueuescript won’t load in footer even with true value set?
- Execution of JavaScript on save post
- Is placing stuff in page text edit window bad form?
- Add colorpicker to featured image
- Gravity Forms not loading under https, jQuery is not defined
- Add a Fancybox automatically to post type “post” images
- Enqueuing javascript files
- WordPress customizer refresh screen after save
- Creating multiple enclosing shortcodes and fixing JS issues on click
- Can’t load a class into WordPress post editor’s content field
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- I want to import my Json file into a custom made display-modal. How do i link my Json file?
- Searching multiple tags and adding jQuery dependant script onto page template?
- TinyMCE 4 remove/add attributes for all images
- Javascript stopped working [closed]
- Why load JS through the CMS framework? [duplicate]
- url – ajax loaded but no JS
- Close Fancybox, sumbit form data and redirect
- Loading scripts on a single page plants the script in the footer
- Nested Gallery Shortcode INTERMITTENTLY working
- Accessing javascript in multiple files [closed]
- Issues loading Jquery on WordPress website
- Custom AJAX form not working async
- click event to unhide something after ajax not firing
- Is it OK combined wp-include js, jquery, css? [closed]
- Including Older Version of jQuery for IE7/IE8
- Parse wordpress blog data using json api and ajax
- Problem adding MP3 attachments to a jPlayer playlist
- Jquery not working
- A carousel slideshow plugin in JavaScript
- JS behavior differs depending on page tree [closed]
- Putting custom html/js page into Elementor as it’s own block
- Add other class content with reference class value
- Can’t Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM
- Theme customisation – how to store javascript externally when it utilises php variables?
- Get ajaxForm response value
- onclick jquery function not working in wordpress header file [duplicate]
- How can I add a new lib path without call each one on the header?
- Adding scripts before plugins scripts
- jQuery search function not running in WordPress but running locally (fiddle)
- Masonry – Can’t Find Variable imagesLoaded
- Clear custom field when new tag is added
- change the icon of a custom post type in WordPress to use twitter boostrap
- Element works, but not on wordpress site [duplicate]
- javascript not loading in wordpress
- JS file not loading [closed]
- Carousel Hover Image
- How to Javascript/jQuery
- can’t make jQuery work (change image on time interval) [closed]
- Styling parent based on a child element of a child in a WordPress page