We have a simple textarea and a button.
<input type="button" id ="foo" disabled>
<textarea rows="12" name="message" id="message" cols="50"></textarea>
I need to:
- remove attribute disabled from button when some text in textarea selected
- set attribute disabled when selection canceled
First task was achieved with this code:$('textarea').select(function() {
$('#foo').attr('disabled','');});
But with the second task i havn't any ideas.