The following CSS rules are added to the body style to disable text selection:
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE/Edge */
user-select: none; /* Standard */
JavaScript to Apply prevent-copy Class:
The following JavaScript code is added at the end of the <body>:
JavaScript
document.addEventListener('DOMContentLoaded', function() {
const body = document.body;
body.classList.add('prevent-copy'); // Apply the class on load
});