How to fade out textarea after copying the value?

I have this basic HTML code:

<textarea id="textarea" cols="30" rows="10">This is sample value</textarea>

How can I fade out the textarea after 1 second after user press Ctr + C after selecting or right click and copy the text This is sample value in the textarea?

Answers


You can use jQuery copy event along with setTimeout function:

$('#textarea').on('copy', function() {    
    setTimeout(function() {
        $('#textarea').fadeOut();
    }, 1000);
});

FIDDLE


Need Your Help

Quartz Scheduler: How to dynamically read a quartz property from Java via API?

java quartz-scheduler

Quartz is usually configured via quartz.properties on the classpath.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.