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

239
Views
Menu automatically pops up when selecting the text

If I would like a menu to pop up automatically just as I select the text (no further clicking is needed), what method could be one of the choices? Thank you!

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
Paragraph 1: In the seventeenth and eighteenth centuries, the British parliament enacted a number of laws, called Navigation Acts, governing commerce between Britain and its oversea colonies. For example, the Navigation Acts of 1600 and 1603 barred the empire’s colonial merchants from exporting such commodities as sugar and tobacco anywhere except to England and from importing goods in non-English ships. Similarly, the Mollases Act of 1733 taxed all foreign mollases (a thick liquid drained from sugarcane and used to make rum) entering the mainland American colonies at sixpence per gallon. This act was intended less to raise revenue than to serve as protective tariff (tax) than would benefit British West Indian sugar producers at the expenses of their French rivals. By 1750 a long series of Navigation Acts were in force, with several effects on the North American colonial economy.
</body>
</html>

enter image description here

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

0

You can use this:

Just change the alert part to whatever you wanna do

var t = '';
function gText(e) {
    t = (document.all) ? document.selection.createRange().text : document.getSelection();
        if (t == "raise revenue" || t == " raise revenue" || t == "raise revenue " || t == " raise revenue ") {
            alert("Popped UP!!!")
    }
    
}

document.onmouseup = gText;
if (!document.all) document.captureEvents(Event.MOUSEUP);
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
Paragraph 1: In the seventeenth and eighteenth centuries, the British parliament enacted a number of laws, called Navigation Acts, governing commerce between Britain and its oversea colonies. For example, the Navigation Acts of 1600 and 1603 barred the empire’s colonial merchants from exporting such commodities as sugar and tobacco anywhere except to England and from importing goods in non-English ships. Similarly, the Mollases Act of 1733 taxed all foreign mollases (a thick liquid drained from sugarcane and used to make rum) entering the mainland American colonies at sixpence per gallon. This act was intended less to raise revenue than to serve as protective tariff (tax) than would benefit British West Indian sugar producers at the expenses of their French rivals. By 1750 a long series of Navigation Acts were in force, with several effects on the North American colonial economy.
</body>
</html>

Modified Robert's answer to suit your problem

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!