I am using blackboard in my university. My students will have an exam online next month.
I am trying to prevent them to use copy, paste, select, right-click during the exam. I saw a lot of solutions using javascript.
When I used onpaste and oncopy it is work. whereas, adding the onselectstart and oncontextmenu to the code not work.
Could you please help me.
Thanks
<script type="text/javascript"> document.oncopy=new Function("return false"); document.onpaste = new Function("return false"); document.onselectstart = new Function("return false"); document.oncontextmenu = new Function ("return false"); </script>
Make your HTML body tag like this-
<body oncopy="return false;" oncut="return false;" onpaste="return false;" oncontextmenu="return false;">
....
</body>
<body oncopy="return false;" oncut="return false;" onpaste="return false;" oncontextmenu="return false;"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt natus optio odit sequi, vero, soluta inventore similique laudantium incidunt qui voluptatibus unde quod blanditiis ut facilis molestias necessitatibus, repudiandae eveniet.</p> <textarea rows="5" cols="30"></textarea> </body>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.