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

157
Views
Have text that pops up when clicking a button be inside the page

Let me preface the question by saying I have very limited coding knowledge so I might not be using the proper technical terminology.

I have a webpage with some questions and a button beneath each question which, when clicked, displays an explanation of the answer in a pop up. The pop-up appears in the same web address and when I click outside it, it disappears. Here is the code of a typical question

<div class="question_text" style="display: flex;flex-direction: row; ">
<h4 class='question_load';'>1) What is 8 - 5? </h4></div>
       <p style='font-size:15px;' class='option1  '>a) 1</p>
       <p style='font-size:15px;' class='option2  '>b) 2</p>
       <p style='font-size:15px;' class='option3 answer '>c) 3</p>
       <p style='font-size:15px;' class='option4  '>d) 4</p>

Below is the code of a typical button:

<p><span class="btn_show explain_btn" get_id="1-1">Show explanation</span>

By my rudimentary understanding this is controlled by some script. Given below is what I believe is the relevant bit for this function:

$(document).on('click', '.explain_btn', function() {
var hiyt = $(this).attr('get_id');
get_explain_data(hiyt);
});

function get_explain_data(hiyt){
$.get("/get_explain/"+hiyt+"/", function(data, status){
  modal.show();
  modal.find("h4").html(data);
  modal.find(".modal-button").click(function(){
      modal.hide();
  });
  });
}

I have managed to extract the questions and answers by copying the code in a text editor and saving as a .htm file. The Show explanation button is present, however when the button is clicked, nothing happens. It only works while I am logged into the website. I would like the text that appears in the pop ups to be displayed as text below each question. I have not found the explanation texts anywhere in the code of this page, so I assume it's being loaded from somewhere else.

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

0

You can achieve this easily with a javascript alert:

<p><span class="btn_show explain_btn" get_id="1-1" onclick='<script>alert("Everything you want.\nFore new line");</script>'>Show explanation</span>
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!