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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:32:18+00:00 2026-05-31T09:32:18+00:00

My text/value in textarea it’s not static – I’m chaning it. I can’t get

  • 0

My text/value in textarea it’s not static – I’m chaning it. I can’t get the current value.
E.g
1

<textarea>
Lorem ipsum
</textarea>
//it's defalut in html file

2

Putting into textarea:

Dolores is lorem ipsum

Alert is only showing 1 version("lorem ipsum"), but not second ("Dolores is lorem ipsum"). I’m trying to do it in jquery:

var variable = $("#selector").val();
alert(variable);

What I’m doing wrong?

EDIT

I want to catch it to variable 🙂 Not to alert. Alert is only my test 🙂

  • 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-31T09:32:19+00:00Added an answer on May 31, 2026 at 9:32 am
    var text = $('#textareaID').val();
    
    $('#textareaID').change(function() {
      text = $(this).val();
    });
    

    when ever you want text just reference it 🙂

    EDIT:

    If your using tabs UI please review the docs and the event management:

    Place This outside of bound scope:
    var text = $('#textareaID').val(); OR var text = '';
    
    $('#example').bind('tabsselect', function(event, ui) {
          // Objects available in the function context:
          // ui.tab anchor element of the selected (clicked) tab
          // ui.panel element, that contains the selected/clicked tab contents
          // ui.index zero-based index of the selected (clicked) tab
          // INSIDE HERE IS WHERE YOU CAN PUT THE CODE IN THE ABOVE EXAMPLE
          $('#textareaID').change(function() {
                text = $(this).val();
          });
    });
    

    NOTE: $(‘#example’) would be the parent div that holds the tabs and content

    Further optimization recommendation.

    If you think $(‘#textareaID’) will be called often you may want to cache a reference to it so the selector engine does not have to find it on every instance, this would be done like:

    var textarea = $('#textareaID');
     var text = $('#textareaID').val();
    

    For this line:

    var textarea = $('#textareaID');
    

    Make sure it is inside of a $(document).ready(function() {}); Call and the element is exists

    you could check for this by doing:

    var textarea = $('#textareaID') || false;
    

    And wrap the code above like this:

    $('#example').bind('tabsselect', function(event, ui) {
              // Objects available in the function context:
              // ui.tab anchor element of the selected (clicked) tab
              // ui.panel element, that contains the selected/clicked tab contents
              // ui.index zero-based index of the selected (clicked) tab
              // INSIDE HERE IS WHERE YOU CAN PUT THE CODE IN THE ABOVE EXAMPLE
    
              if(textarea) {
                   textarea.change(function() {
                        text = $(this).val();
                   });
              }
        });
    

    Hope this helps!

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

Sidebar

Related Questions

How can I get the text value from an elements's child? Say I have
How can I get the text value of a segment in a UISegmentedControl?
Any reason why jQuery('textarea').text() always returns default value instead of current text when the
I am trying to do this: $('input:text','textarea').focus(function () { $(this).removeClass('wrong'); if (this.value == this.defaultValue){
Ok, Here's the exampe: <table> <tr> <td> <type=button id=mybutton value=insert> </td> <td> <textarea>My Text</textarea>
If I use textarea.value then I get an error, so I tried to use
How can I pass the value of textarea to a new page according to
The html form accepts textarea input, and I am using $_POST value to put
here is the code sample: HTML: <form id=information name=information action=# method=post> <textarea name=text rows=10
I'm trying to empty wherever value/text in the textarea, when a file is uploaded

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.