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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:57:29+00:00 2026-06-04T14:57:29+00:00

I am using function example_append() { $(‘#containment’).append($(‘#example-textarea’).val()); } This is throwing the text I

  • 0

I am using

function example_append() {
  $('#containment').append($('#example-textarea').val());
}

This is throwing the text I put in the form field in to the div #containment. I’d like to place the value of the form field into the containment div, but also have it wrapped in a div with a class name so I can style it. Is this possible?

Also, the user inserts the text via the form field and it gets thrown into that div, how could I remove that string of text if the user wants to start over?

  • 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-04T14:57:29+00:00Added an answer on June 4, 2026 at 2:57 pm

    These two functions should do what you’re looking for. Just bind reset_text to a button or text on click.

    edit Added event bind for clearing text.

    function example_append() {
       $('#containment').append(
          $('<div />').addClass('className').text($('#example-textarea').val())
       );
    }
    
    $(document).ready( function() {
       $('#example_button').on('click', reset_text );
    });
    
    function reset_text() {
       $('#example-textarea').val('');
       $('.className').remove():
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to append text at the begin using function appendText? For example: HTML: <div
Consider the following example: HTML: <div id=cool-div></div> JS/jQuery: var ComplexObject = function() { this.Append
So I have this neat little javascript function that I'm using to print text
Here is an (artificial) example of using a function that returns an anonymous struct
How can I omit Zeros in my data? For example using the MIN function?
is there any example on using java method to call rhino-javascript function and return
For example, i'm using the beforeSend option in the $.ajax function. In the code
I'm using JQTOUCH using the AJAX example provided in the demo: $('#customers').bind('pageAnimationEnd', function(e, info){
I want to use gcd function of the Integer class. Using the example from
I wrote a simple example, which estimates average time of calling virtual function, using

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.