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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:55:46+00:00 2026-05-28T20:55:46+00:00

I have a div with text inside: <div id=test>Some text here to edit</div> When

  • 0

I have a div with text inside:

<div id="test">Some text here to edit</div>

When the users clicks on this it needs to change to:

<form name="input" action="html_form_action.asp" method="get">
Edit: <input type="text" name="tex" value="Some text here to edit"/>
<input type="submit" value="Submit" />
</form> 

How can I make it so when the user clicks on the text in the div, it will transform into an form/input box like above?

  • 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-05-28T20:55:47+00:00Added an answer on May 28, 2026 at 8:55 pm

    Demo

    With HTML and jQuery (a JavaScript framework): http://jsfiddle.net/3qHst/1/.

    Additional info

    jQuery doc: .click(), .hide() and .show().

    Code

    html:

    <div id="test">Some text here to edit</div>
    
    <form name="input" action="html_form_action.asp" method="get" style="display: none;">
        <label for="comment">Edit:</label>
        <input type="text" id="comment" value="Some text here to edit"/>
        <input type="submit" value="Submit" />
    </form>
    

    jquery:

    $('#test').click(function(){
       $(this).hide();
       $('form').show();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have some HTML like so: <div id=text>This <i>is</i> a <b>test</b>. Do
I have a div element containing some text. When the user clicks a word
I have some text that is stored in a variable like this: <div class=foo>text
I have a div with a width of 200px. There is text inside that
i have a click event for $('#blah div'). div has text inside of it
I have this div: <div class=inauguration-image> I do not want this text to display,
i have text like this div bla-bla end div i need to get only
I have a div contain the image inside it like this : <div class=gallery
I'm trying to wrap each text character inside a <div id=test></div> with a span
I have created form inside a template file. Form code looks like: <div id=form

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.