Search code examples
javascriptjqueryhtmldomruby-on-rails-plugins

Auto paste clipboard jquery after click on input?


How I can set auto paste clipboard, when input is active ? Is it possible to do it when page is ready ?


Solution

  • Allowing an automatically triggered paste event from a browser standpoint is a security risk so browsers don't support it. Using JavaScript you can manipulate the on paste event but that's obviously after the fact.

    Here's an altered fiddle from a similar post http://jsfiddle.net/5bNx4/287/

    it shows the $(ele).on("paste") event in action if you're interested.