Click here to Skip to main content
15,897,315 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to call event of textChange of textarea by jquery or javascript

I used below code

JavaScript
$(document).ready(function () {
        $("textarea").change(function () {
            $(this).hide();
        });
    });


but it's not good

below code is true

JavaScript
$(document).ready(function () {
        $("textarea").click(function () {
            $(this).hide();
        });
    });


but problem is in event of change

I want a thing like to textCahnge for textbox in asp.net
but with jquery or javascript for textarea
Posted
Updated 9-Sep-13 6:49am
v4
Comments
Sergey Alexandrovich Kryukov 9-Sep-13 15:05pm    
There is no such thing as "call event".
—SA

try this
JavaScript
$('#textareaID').bind('input propertychange', function() {

     alert("Onchange event" ); 
})
;
hope this helps
 
Share this answer
 
You are missing in a # sign in your code
$("textarea").change


The following code segments detects the textarea change event on loss focus using jquery

XML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>

    </title>

    <script src="http://code.jquery.com/jquery-2.0.3.js"></script>
    <link href="css/custom.css" rel="stylesheet" />
    <script>
        $(document).ready(function () {


            $("#textareaid").change(
                function () {

                    alert("changing");
                }

                );

        });
    </script>
</head>
<body>

   Text Area : <textarea id="textareaid"></textarea>
   click here after text change : <input type="text" />

</body>
</html>
 
Share this answer
 
v2
I found it

JavaScript
<script>
changeTextarea();

function changeTextarea()
    {
        //................check changing of texaarea
        setTimeout("changeTextarea()", 500);
    }
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900