Since you want them to alternate the easiest would be to use show()
and hide()
rather than toggle()
, since you don’t actually want to toggle the visibility if the login is clicked more than once, you want it to always show the #login and hide the #create. Also note that the live()
function has been deprecated in favor of on()
. See this example:
jQuery(document).ready(function(){
jQuery('#sign-in').on('click', function(event) {
jQuery('#login-content').show();
jQuery('#create-content').hide();
});
jQuery('#create-account').on('click', function(event) {
jQuery('#create-content').show();
jQuery('#login-content').hide();
});
});
Related Posts:
- How do you use the ? : (conditional) operator in JavaScript?
- “Uncaught SyntaxError: Cannot use import statement outside a module” when importing ECMAScript 6
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How to reload a page using JavaScript
- jQuery: Wait/Delay 1 second without executing code
- How to play audio?
- How do I test for an empty JavaScript object?
- Tallest Unicode character?
- How to solve ‘Redirect has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header’?
- jQuery setTimeout() Function [duplicate]
- Parse Error: Adjacent JSX elements must be wrapped in an enclosing tag
- Nested JSON objects – do I have to use arrays for everything?
- How to find the sum of an array of numbers
- JavaScript null check
- Remove Object from Array using JavaScript
- Regular expression : match either of two conditions?
- jQuery AJAX submit form
- Difference between this and self in JavaScript
- HTML5 Local storage vs. Session storage
- What does href expression do?
- Expressjs / Node.js – res.redirect() not loading page
- Using async/await with a forEach loop
- How to check if two arrays are equal with JavaScript?
- What is causing the error `string.split is not a function`?
- Does JavaScript have a built in stringbuilder class?
- How do I check if an object has a key in JavaScript?
- How to add a “readonly” attribute to an ?
- JQuery $(“#content”).append not working
- What is the difference between null and undefined in JavaScript?
- Pass react component as props
- How to fix Cannot find module ‘typescript’ in Angular 4?
- Origin null is not allowed by Access-Control-Allow-Origin
- Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded
- Counting words in string
- What’s “this” in JavaScript onclick?
- how to use react require syntax?
- document.getElementById(id).focus() is not working for firefox or chrome
- How to get height of div in px dimension
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- What is the difference between String.slice and String.substring?
- How to use in jQuery :not and hasClass() to get a specific element without a class
- How to get unique values in an array
- How to fix Error: listen EADDRINUSE while using NodeJS?
- How to allow CORS in react.js?
- Only on Firefox “Loading failed for the script with source”
- How do you use a variable in a regular expression?
- How to embed a youtube playlist with a sidebar
- How to add a button dynamically using jquery
- External JavaScript Not Running, does not write to document
- Create a simple 10 second countdown
- When is a CDATA section necessary within a script tag?
- How to get scrollbar position with Javascript?
- where is create-react-app webpack config and files?
- “You may need an appropriate loader to handle this file type” with Webpack and Babel
- How to create checkbox inside dropdown?
- Find a value in an array of objects in Javascript [duplicate]
- What does `node –harmony` do?
- Preventing YouTube embeds loading multiple instances of player JS?
- How to handle malformed response from WP REST API?
- Use useSelect/useDispatch instead of withSelect/withDispatch
- Trouble adding JavaScript in visual editor (Sharpspring embed code)
- Modals using loops and ACF [closed]
- Changes to JS not reflected on site
- How to set translations in javascripts for my plugin?
- How do developers add “Smooth Transitions” to their sites?
- Exclude JS file from 404 error page
- Pass data from wordpress to javascript in JSON
- How to make wordpress URLS google friendly for ajax driven sites?
- How can I get my Calculate Contact Form 7 field to update with jQuery? [closed]
- Contact Form 7 – Uncaught TypeError: wpcf7.initForm is not a function [closed]
- js addclass function not working as expected, intereaction or special WP somethign needed?
- Where is script-loader.php creating JS tags
- WP TinyMCE (Full + media ) – 4.8 JS Init Dynamicly
- Get a default value of the Customizer setting using wp.customize API (JS)
- Google PageSpeed Enable Compression isn’t working?
- How can I add Javascript in the header of all post pages and only post pages
- Search for a keyword across post types in a Gutenberg component
- Calling a WordPress Custom JavaScript file
- print script on wordpress header after user registered
- How do I use this javascript correct with wordpress?
- Load external javascript files
- Javascript alert appears before tag
- Add captcha validation to my custom form for Frontend posting
- AddThis Sharing Bar Not Displaying on Custom Page Template – JS conflict?
- Bootstrap bundle present in page source but not working
- How to display different content on the same page using different URLS
- Web cover page open when button clicked
- Replace script attr or link
- Access checks with custom REST endpoints and backbone
- Remove escape characters from JSON string pulled from a database
- How to pass data to javascript in custom widget class
- Client side pre-save Javascript hook on all admin pages
- WP Gutenberg – custom block with two content fields
- How to add additional JavaScript code [duplicate]
- How to implement custom URL handler to access JS modal content? [closed]
- Contact form 7 hide and show fields depending up on the condition [closed]
- Masonry grid with bootstrap 4
- How to detect if we are in the Site Editor part of the Block Editor (as opposed to editing a Page/Post) in JavaScript?
- How can I show a Slot/Fill in the block editor
- How to add more elements to an already existing section in Gutenberg