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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:07:03+00:00 2026-05-29T04:07:03+00:00

I have a jsfiddle http://jsfiddle.net/4Pc4B/10/ . In the jsfiddle, type in a question in

  • 0

I have a jsfiddle http://jsfiddle.net/4Pc4B/10/. In the jsfiddle, type in a question in the textarea and then click on the “Add Question” button. This adds the question in a new row underneath but the problem is that when this happens, the textarea at the top still displays the question. I want it so that if the user has clicked on the “Add Question” button AND if the question is added in a new row, then the textarea on top should go blank. How can this work?

Below is code to make the textarea blank:

var area = document.getElementsByTagName('textarea');
for (var i = area.length-1; i>=0; i--) {
if ('questionText'===area[i].name) area[i].value = "";
}

Where do I display this code?

Thanks

  • 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-29T04:07:04+00:00Added an answer on May 29, 2026 at 4:07 am

    Simply add:

    $('#questionTextArea').val('');
    

    Below the line:

    $question.append($questionText);
    

    JS Fiddle demo.


    Edited in response to question from OP, user1182476, in comments, below:

    By the way, If I have a radio button which is selected but after adding a table row I want all the radio buttons to be unchecked, how do I do this?

    To un-check all radio buttons:

    $('input:radio:checked').prop('checked',false);
    

    It seems that you, essentially, want to reset the form back to its default state, though, and to do that you might find it easier to simply use:

    $('#enter')[0].reset();
    

    JS Fiddle demo.

    Or:

    document.getElementById('enter').reset();
    

    JS Fiddle demo.

    Inserting either of these lines, as shown in the linked demos, instead of the line supplied in the first version of this answer (so after the same line as before: $question.append($questionText);).

    The reason for using [0] in the first example, and document.getElementById() in the latter, is because the reset() method works on the plain JavaScript DOM node, not the jQuery element.

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

Sidebar

Related Questions

i have this: http://jsfiddle.net/uAQ8B/5/ This list should have all the objects on the left
I have created this jsfiddle: http://jsfiddle.net/mfnxm/1/ I am trying to create this JSON: [{
In this jsFiddle http://jsfiddle.net/littlesandra88/RBU8K/ have I the following code function addRemove(id) { alert(1); $('#'+id).toggle(function()
I have the following code at JSfiddle: http://jsfiddle.net/ACG2D/ $(document).ready(function() { $('.testThis').click(function() { $('.regexValidation').each(function() {
If you look at this JSfiddle http://jsfiddle.net/littlesandra88/G3N4m/ you will see that I have input
I have this: http://jsfiddle.net/ETm93/ Now my floated element, leftPanel is having a margin-right: 20px;
I have the following jsfiddle setup: http://jsfiddle.net/zZDqH/ Currently it is just a button that
Here is a very simple example of what I have: http://jsfiddle.net/MxKLU/ Click on the
I have this jsfiddle http://jsfiddle.net/fwQq4/19/ Here I have the wrapper class ( div.wrapper )
I have a jsFiddle set up for this: http://jsfiddle.net/eventide/TAmam/ I'm trying to apply the

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.