JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<center>
<div id="scrollDiv"><article id="ArticleToHighlightRFS">
While awaiting execution, Bonhoeffer recorded a number of his thoughts in a work we now know as Letters and Papers
from Prison. One of these essays, entitled On Stupidity, records some of the problems which Bonhoeffer likely saw at work
in Hitler’s rise to power:
“Upon closer observation, it becomes apparent that every strong upsurge of power in the public sphere, be it of a political
or a religious nature, infects a large part of humankind with stupidity. … The power of the one needs the stupidity of the other.
The process at work here is not that particular human capacities, for instance, the intellect, suddenly atrophy or fail. Instead,
it seems that under the overwhelming impact of rising power, humans are deprived of their inner independence and, more or less consciously,
give up establishing an autonomous position toward the emerging circumstances. The fact that the stupid person is often stubborn must not
blind us to the fact that he is not independent. In conversation with him, one virtually feels that one is dealing not at all with him as a
person, but with slogans, catchwords, and the like that have taken possession of him. He is under a spell, blinded, misused, and abused
in his very being. Having thus become a mindless tool, the stupid person will also be capable of any evil and at the same time incapable of seeing that it is evil. This is where the danger of diabolical misuse lurks, for it is this that can once and for all destroy human beings.”
</article></div>
</center>
CSS
#scrollDiv {
word-wrap: break-word;
width: 600px;
max-width: 600px;
min-width: 600px;
height: 700px;
max-height: 700px;
min-height: 700px;
overflow-y: scroll;
border: 2px solid red;
margin-left: 10px;
margin-right: 10px;
margin-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
}
JavaScript
function winsel() {
var sel = window.getSelection();
alert(sel);
}
$(document).ready(function() {
$("#ArticleToHighlightRFS").bind("mouseup", winsel);
})