Guest User

Untitled

a guest
Jun 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. window.onload = function call() {
  2.  
  3. function greatFunction(elem) {
  4.  
  5. //do stuff
  6. }
  7. var textEditor1 = $('#cl1').find('textarea');
  8. textEditor1.on('focus change mousedown mouseout keyup mouseup', function () {
  9. greatFunction(this)
  10. });
  11.  
  12. var textEditor2 = $('#cl2').find('textarea');
  13. textEditor2.on('focus change mousedown mouseout keyup mouseup', function () {
  14. greatFunction(this)
  15. });
  16.  
  17. var textEditor3 = $('#cl3').find('textarea');
  18. textEditor3.on('focus change mousedown mouseout keyup mouseup', function () {
  19. greatFunction(this)
  20. });
  21. }
  22.  
  23. <div id="cl1" class="cl active"><textarea id="chatTextarea" class="chatTextarea"></textarea></div>
  24. <div id="cl2" class="cl"><textarea id="chatTextarea" class="chatTextarea"></textarea></div>
  25. <div id="cl3" class="cl"><textarea id="chatTextarea" class="chatTextarea"></textarea></div>
Add Comment
Please, Sign In to add comment