Change text from a div within fancybox

0

I have a popup using Fancybox, inside it I have a div, I need to dynamically change using Javascript the text of it. I'm using the following code in the click of a button call:

$('#id-da-div').html('Novo texto');

This simple code works anywhere on my site, but when the div is inside Fancybox it does not work. It does not make any mistake, it simply does not update the html within the div.

It should be something from Fancybox, I need to solve it by putting a counter inside the popup.

Thank you.

    
asked by anonymous 17.08.2017 / 02:22

1 answer

0

Select the element within Fancybox:

  • Type F12 to open "developer tools" in your browser.
  • Select the element that has the text to be changed.
  • In the source code shown in the panel, right-click on the element.
  • In the menu select "Copy > Copy selector" and paste the copied code into the jQuery selector: $('CÓDIGO_COPIADO').text('Novo texto');
  •     
    17.08.2017 / 02:55