<input type="text" class="input-prohibit-drop" placeholder="you can not D&D text">

<p>The quick brown fox jumps over the lazy dog</p>
*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100vh;
}

.input-prohibit-drop {
  padding: 0.5rem;
  width: 20rem;
}
document.querySelector(".input-prohibit-drop").addEventListener(
  "drop",
  function(e) {
    e.preventDefault();
  },
  true
);
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.