Jquery get textarea value

Jquery val() method, get input,textarea value.

<html>
<head>
    <title>Jquery get textarea value</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>

<h1>Jquery get textarea value</h1>

<textarea placeholder="Enter here" id="t"></textarea>

<button id="b">Get textarea value</button>

<script>
$('#b').click(function() {
    var x = $('#t').val();
    
    alert(x);
});
</script>

</body>
</html>

Related Sourcecode

More Sourcecode

×
Google login
SignUp with Email
X