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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:42:55+00:00 2026-06-11T15:42:55+00:00

This does not work in IE10 but it does in other browsers: http://jsfiddle.net/54EKK/2/ If

  • 0

This does not work in IE10 but it does in other browsers: http://jsfiddle.net/54EKK/2/

If you enter text in the textarea and set the variable, the variable retains the contents of the textarea.

Of course if you set the variable before adding content (outside of the function) it will be empty, but in my project I can not do that. Here is a demo of that. It works in all browsers: http://jsfiddle.net/54EKK/3/

Now my question is if there is a way to empty the textarea while still keeping the variable in the function. BTW emptying the value does not help either.

Thanks for your insights guys!

(I am afraid of not being clear in how I explained things so please tell me if not!).

  • 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-11T15:42:57+00:00Added an answer on June 11, 2026 at 3:42 pm

    As far as I can tell, that only works in IE9. I have tried Firefix, Chrome, Safari and Opera, and neither gets you the textarea content when using innerHTML.

    When you use innerHTML, that will give you the value attribute, which is the original text that was set in the form field. The value that you type into the form field is in the value property.

    If you want the content of the form fields when using innerHTML, you have to copy the value property into the value attribute for each form field.


    Edit:

    As your clarified that what you really want is to just clear the textarea, then set the value of the textarea element to an empty string.

    You need to access the element, so you might want an id on it:

    <textarea id="txt"></textarea>
    

    Then when you want to clear it, you get the reference to it and clear the value:

    document.getElementById('txt').value = '';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per my observation this does not work in flex4: <mx:TextArea id=taMytext text=\n hi\n
Quick and silly jQuery selector question. Why this does not work : jsFiddle demo
<style type=text/css> #[':0:adId'] { /* this does not work */ background:red; } </style> <div
I'm trying something like this, but this example does not work. jsObj = {};
This does not work the way I want to. currently, the text field activates
This does not work. I'm trying to learn how to use std::copy but I
This works <?php include(inc/c.php)?> But in a folder past this, this does not work
I recently realized, when styling HTML5 input placeholder text, that this does not work:
So the following works: alert(Number().toString.call(1)); But this does not work: alert(Number.toString.call(1)); Furthermore, the following
The following line This does NOT work in my code in firefox/firebug (but works

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.