Reputation: 591
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
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();
});
Upvotes: 2
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