JSFiddle - React, Tailwind, and code Playground

by Sourabh Singh Rathore

HTML

Copy me

<input type="text" placeholer="paste here" />

CSS

body {
  background: black;
  color: white;
}

.inverse {
  background: blue;
  color: black;
}

JavaScript

$('body').on('copy', function() {
  $('body').addClass('inverse');
  setTimeout(function() {
    $('body').removeClass('inverse');
  },100);
});

$('input').on('paste', function() {
  $('input').addClass('inverse');
  setTimeout(function() {
    $('input').removeClass('inverse');
  },100);
});