JeffreyR
JeffreyR

Reputation: 591

Show submit button on textarea edit

I have a textarea and a button. I want the button to appear if the text in the textarea is edited. Not on focussed but on edit test. Is this possible in jquery?

Upvotes: 3

Views: 1086

Answers (2)

Sridhar R
Sridhar R

Reputation: 20418

Try this

HTML

<textarea id="t_area" rows="3">444</textarea>
<button id="btn" style="display:none">Save</button>

Script

$('#t_area').on('keyup',function() {
    $('#btn').show();
});

DEMO

Upvotes: 2

Polynomial
Polynomial

Reputation: 3706

You could handle the .change() event of the textarea to show the button. At its simplest:

$('#textarea').change(function() {
    $('#button').show();
});

Modify the element ID selectors to suit your code.

Upvotes: 1

Related Questions