Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda