With this I'd like to change the default select behavior for a document. I do that for the document body with getElmentsByTagName
. But the code doesn't actually have the desired effect, which is to prevent the user from clicking to select text in the document.
<script>
$(document).ready ( function () {
document.getElementsByTagName("body").addEventListener('mousedown', function(e) { e.preventDefault(); }, false);
});
</script>
This works elsewhere on my site to prevent select on specific page elements. How do I do this for the entire document?