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

  • Home
  • SEARCH
  • 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 9020287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:58:48+00:00 2026-06-16T04:58:48+00:00

I am beginner of js. I want to make a editor like PHPAdmin. When

  • 0

I am beginner of js. I want to make a editor like PHPAdmin. When click its table, the field will change to text-area. When click some where else outside of the text-area, it will change back to the filed and execute the sql.

Following is what I suppose to write with jQuery, I am totally not understand how should I code it further, please advice.

$('#editor #gird_edit').bind({
  click: function() { //When Click
      var content = $(this).text(); // read what is in the filed
      $("#gird_edit").text('<textarea>'+a+'</textarea>'); // This is not work, will only add html code,not change to text-area
  },
  /* ??? */: function() { //Outside click of the text-area 
      var content = $(this).text(); // read what is in the text-area
      $("#gird_edit").text(????);  // change back to the filed 
  }
})

Html

<div id='editor'>
   <div id='gird_edit'>hallo world</div>
   <div id='gird_edit'>hallo world 2</div>
   <div id='gird_edit'>hallo world 3</div>
</div>

I only have 3 reputations, just joined yesterday…I am sorry for that I cannot vote you since it requires 15 reputations. However, I will very appreciate you help!!

  • 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-16T04:58:50+00:00Added an answer on June 16, 2026 at 4:58 am

    If you want to detect clicks outside of an element, just detect them on the whole page, and throw out any that come from inside the element. In other words:

    $('body').on('click', : function(e) { //Outside click of the text-area 
        if ($(this).parents().is('#gird_edit')) return false;
        var content = $('textarea').text(); // read what is in the text-area
        $("#gird_edit").text(????);  // change back to the filed 
    });
    

    However, it sounds like what you’re really looking for is a “blur” handler, which will trigger whenever someone was inside a textarea and just left it; you can make one of those the same basic way you made your click handler:

    $('#gird_edit textarea').bind({
        blur: function() {
            // do the reverse of the click handler
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a program that's like a simple text editor using Qt
I am a java beginner and I want to make a simple text editor
I am beginner at Sharepoint and i want to make a small application on
i m the beginner in iphone programming i want to make an application which
hiiiii, i am a beginner for iphone and i want to make so much
Hello I want to make simple shopping cart. I am a beginner in programming.
I am a beginner in Mysql Php. I want to make a search box
i want to make an application or more like a tweak for android i
I have a working Joomla extension (YT Mega menu). I want to make some
I am a beginner to PHP and i want to make a static method

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.