Fill a bubble with the HTML of a hidden div

Fill a bubble with the HTML of a hidden div

Hi,

I'm quite new to the jquery and javascript stuff. I used the "CreateBubblePopup", filling it with html directly in javascript. Until now, it was working fine.
For some reasons, now I need to write this HTML inside the page (in a hidden div), and then load this html inside the bubble when it's created. Here is the code :

HTML :
  1. <a class="bubble" href="..." >
  2. <img alt="Détail" src="plus.png" />
  3. <div class="hidden">Here is the HTML that will be displayed in the bubble.</div>
  4. </a>
Javascript :
  1. $(".bubble").each(function(){
  2. var popupHtml = $(this).children("div.hidden");
  3. $(this).CreateBubblePopup({
  4. ...
  5. innerHtml: popupHtml
  6. ...
  7. });
  8. });

It seams that my "popupHtml" variable is always null, no matter what the html in the hidden div is.
Do you have any idea why ? What am I doing wrong ?