This question is out of scope here. You should try stackoverflow for this question.
Though I would like to answer your question.
You need to use some CSS as well as JQuery for getting the desired result.
See the working fiddle here.
Hope this works for you.
CSS addition:
input[type=subscribe]:focus + input[type=search] {
display:none;
}
JQuery code:
$(function(){
$("#s").focus(function(){
$("#subscribe").hide();
});
$("#s").focusout(function(){
$("#subscribe").show();
});
})
Related Posts:
- JavaScript Loading Screen while page loads
- Click button copy to clipboard
- How to make html table vertically scrollable
- How to make Bootstrap carousel slider use mobile left/right swipe
- bootstrap 3 navbar collapse button not working
- How to center image in carousel
- Can Twitter Bootstrap alerts fade in as well as out?
- Play/pause HTML 5 video using JQuery
- jQueryUI dialog width
- Random background images CSS3
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- How to empty input field with jQuery
- Automatically decrease font size for long words
- Best approach for loading a sidebar Only if the screen max-width is >900px?
- Twitter Bootstrap Use Collapse in Custom Post Type
- Stylizing external SVG files with jQuery and CSS
- Gravity list field override and adding javascript [closed]
- How do I setup nested repeatable option fields?
- Add a class to posts in increments of 2
- Override theme style with other CSS on a specific page
- How can I make this custom menu work?
- Remove WordPress scripts
- How to make an WordPress element sticky? [closed]
- Accordion scrolls page too low after clicking on the title [closed]
- show/hide div with simple jQuery script [closed]
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- Superfish Menu Not Loading
- Problem Implementing parallax in header of bp-default theme
- get value from selected input
- Is it OK combined wp-include js, jquery, css? [closed]
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- jQuery Validation plugin and Bootstrap 4 CSS classes
- Getting click on item to open closest relevant element (popup) with jQuery
- How Do I change Markup of a link in WordPress
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Lightbox scroll page down on iPhone
- jQuery function not working in WordPress but works in jsfiddle
- Site images are fixed in front of my site content [closed]
- WP Media Uploader modal conflicts with Bootstrap modal
- :first-child applying to all links [closed]
- How to update scrollbar when using Jetpack’s Inifnite Scroller?
- change the icon of a custom post type in WordPress to use twitter boostrap
- Drop Down Category Menu Not Working
- controlling the showing and hiding of the website logo
- How do I add Javascript and CSS files into WordPress?
- can’t make jQuery work (change image on time interval) [closed]
- How to set time delay in javascript
- Disable button in jQuery
- JavaScript: filter() for Objects
- TypeError: $(…).DataTable is not a function
- Enable & Disable a Div and its elements in Javascript
- Check if inputs are empty using jQuery
- Internet Explorer 8 issues with WordPress 3.8
- CSS not pulling in for jQuery UI dialog
- Check if jquery library exist
- Loading style.css and Jquery using HTTPS
- Uncaught TypeError: Cannot read property ‘replace’ of undefined
- Is it worth updating WP admin to jQuery 1.5?
- Adding jQuery dependency prevents my script from enqueuing/loading
- How to pass jQuery ajax URL value
- how to get the comment ID in the front end when the REPLY button is clicked?
- Change header image loaded by jQuery to use HTTPS
- Admin wp_ajax hook returning 0
- Automatic jQuery accordion from header tags
- Add a Fancybox automatically to post type “post” images
- Hide metabox dependant on page template chosen
- Frontend Post with JQuery AJAX to Php Issue
- WordPress Multiple Navigation bars
- How to get all users by custom current user meta (array)?
- wp_dequeue_script not working in my plugin
- Trouble adding inline style after jQuery in the footer!
- jQuery script isn’t posting to database
- $.browser Undefined Seemingly Causing Faulty Page Display
- I’m trying to set the cookie to my site to button on click action ,it is working on when user logged in .When user logged out it’s not working
- Loading scripts on a single page plants the script in the footer
- Getting a ‘slide down’ js panel implemented within WP
- registering new jQuery after wp_deregister_script() not working
- jQuery Show DIV and Remove Button [closed]
- timeouts (ERR_CONNECTION_RESET) on seemingly random files after upgrading to HTTPS
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- Flexslider won’t work with WordPress’ jQuery | Dependencies
- Applying jquery to WordPress admin edit.php
- Load different post_thumbnail for smaller window width (jQuery,WordPress)
- admin ajax php success returns 0
- Selecting multiple options onclick
- my example with ajax doesn’t work
- Best way to add some custom javascript using jquery to a child theme
- Cannot remove error “Conflict with another plugin which overwrites jQuery” from wordpress site
- WordPress not showing jQuery
- Loop through WordPress API response errors
- Jquery scroll animate offset asynchronous
- How to add a custiomized javascipt into a template
- Enqueue javascript that inserts custom php widget into jQuery-constructed div
- Retrieve customizer value using ajax or customizer api and print the value in theme
- CSS conditional on custom field value
- Sorting UL Listing Within the TinyMCE Visual Editor in WordPress
- jQuery .change() Event Bubbling in WP Admin
- My .js file is getting a 404
- Combo box populating a DIV using ajax/jquery