Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8654713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:51:18+00:00 2026-06-12T14:51:18+00:00

Not sure how to solve this. I’m using jQuery.focus() and jQuery.focusout() to trigger an

  • 0

Not sure how to solve this.

I’m using jQuery.focus() and jQuery.focusout() to trigger an Ajax request and rename a post in WordPress. This code works ok in Chrome and Firefox but i can’t get it to work on IE.

snippet:

$('.editname').on('click', function() {

    var input = $('<input id="editcat" type="text" name="editcat" value="' + name + '" />');
    input.appendTo($(this));
    $("#editcat").focus();
});

$(".editname").focusout(function() {

    $(this).children('input').detach();
    $(this).children('span').show();


});

working example: http://jsfiddle.net/moraleida/fE5Tq/3/

Seems that focusout() event is called right after the appendTo in IE, before the browser has time to focus() on the appended input.

Is there a known workaround for this?

EDIT

Changing focusout to blur doesn’t work. Apparently, the problem is that calling $("#editcat").focus(); makes .editname loose focus/blur. If I comment that line, the input appears ok, but when I click to focus on it, it gets detached.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:51:19+00:00Added an answer on June 12, 2026 at 2:51 pm

    As it turns out, the problem was on attaching focusout to the parent element, instead of the input element. This solved it:

    $(".editname").on('focusout', 'input', function() {
    
        // $(this) now refers to the input element, not .editname
        $(this).siblings('span').show();
        $(this).detach();
    
    
        });
    });​
    

    Final working fiddle for reference: http://jsfiddle.net/moraleida/fE5Tq/8/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was considering using drupal to solve this problem, but not sure if it
I have the following to solve and I'm not sure how to approach this:
I'm not sure if this is the right place to post this, but the
I am performing a simple AJAX() request using Jquery (Google hosted 1.7.1 jquery.min.js code)
I'm not sure how to solve this. I tried rewatching the videos but it
I am not sure if there is a quick way to solve this problem.
I'm using C# with Microsoft's Unity framework. I'm not quite sure how to solve
i'm not sure how to solve the following problem: i have a triangle with
I have a simple problem but I am not sure how to solve it.
I've got a problem I'm not sure how best to solve. I have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.