Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda