Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

89
Views
Enable right click on texteditor

I'm using this code in my index.html file, to prevent using right-click except on editing fields:

<script type="text/javascript">
    $(document).ready(function(data){
       $(document).bind('contextmenu',function(e){
        var t = $(e.target).closest('#editor,.validatebox-text');   // enable right click on HTML editor and all input's
        if (!t.length){
          e.preventDefault();           
        }
      });      
    });
  </script>

question is - how to enable right-click on texteditor, too? Thank you

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I tried with :

var t = $(e.target).closest('#editor,.validatebox-text,textarea');

Disclaimer

about 4 years ago · Juan Pablo Isaza Report

0

Adding tags to the closest() function should enable right click on them.

var t = $(e.target).closest('input, textarea');
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!