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 8071195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:38:16+00:00 2026-06-05T13:38:16+00:00

When clicking Click Me, the text turns into a select menu. When changing the

  • 0

When clicking “Click Me”, the text turns into a select menu. When changing the select menu, it updates the text.

Last thing I need to do is if the select menu loses focus (i.e. something other than the select menu is clicked), revert back to the original text. How do I do this?

Thank you

http://jsfiddle.net/tBRf8/2/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 
<title>Select Clones</title>
<style type="text/css">
.hide {display:none;}
</style>

<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> 
<script type="text/javascript">

$(document).ready(function(){

    $('#add').click(function(){
        $('#my-table tbody').append($("#row-clone").clone(true).removeAttr('id'));
    })

    $("#my-table td.edit")
    .on("click", "span", function(){
        var $t    = $(this),
        $html = $t.parent(),
        role  = $t.text();
        $html.html($("#select-clone").clone(true).removeAttr('id').removeAttr('class').focus().blur(function() {alert('Handler for .blur() called.')}));
        //$html.html($("#select-clone").clone(true).removeAttr('id').removeAttr('class'));
    })
    .on("change", "select", function() {
        var $t = $(this),
        val   = $('<span>').html($t.find(':selected').html());
        $t.parent().html(val);
    });

    //$('#select-clone').blur(function() {alert('Handler for .blur() called.')});
    //$('#select-clone').focusout(function() {alert('Handler for .focusout() called.')});

});

</script>

</head>
<body>

<table id="my-table">
  <thead class="hide">
    <tr id="row-clone"><td></td><td class="edit"><span>Click Me</span></td></tr>
  </thead>
  <tbody>
    <tr><td></td><td class="edit"><span>Click Me</span></td></tr>
    <tr><td></td><td class="edit"><span>Click Me</span></td></tr>
    <tr><td></td><td class="edit"><span>Click Me</span></td></tr>
  </tbody>
</table>
<br />
<select id="select-clone" class="hide">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>

<button id="add">Add</button>

</body>
</html>
  • 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-05T13:38:20+00:00Added an answer on June 5, 2026 at 1:38 pm

    Use $("td.edit select").focus(); to focus on the select box when it is shown, and then use the blur event:

    $('#select-clone').blur(function () {
      $(this).hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While double-clicking the text of a QTreeView expands the children, a single-click does not.
Say I want to modify a text by clicking on it, which turns to
Please refer the fiddle http://jsfiddle.net/HCqsM/5/ Here By clicking the 'click' link for the first
Is it possible to add button click event by clicking design of axml? if
In the past I thought when right-clicking on a table in SSMS and click
I currently have a delayed task that runs whenever I click a button. Clicking
Triple-clicking the mouse to select a paragraph sets document.getSelection().leftOffset to 0 (which seems right)
I'm trying to expand and collapse a <div> by clicking some text inside the
I have some elements like <a class='link'>click</a> which are created after clicking on another
This code adds the text liked inside div.gdt-starrating : $(a.gdt-starrating).live(click, function() { $(div.gdt-starrating).text(liked); });

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.