Automatically open div in Facebox

Using the Facebox Documentation , I am trying to pop up Facebox programmatically, and the contents of Facebox is the div that is in the document,

The problem is that it does not open with this content - it opens empty. What am I doing wrong? The full code with an example is contained in this jsFiddle: http://jsfiddle.net/N4B4v/1/

<div id="#TEST10" style="display: none;"> HEYYYY! <br /> <br /> heyyyyy! </div> <div style="margin-bottom: 10px;"> <a href="#" onclick="jQuery.facebox({ div: '#TEST10' }); return false;"><input type="checkbox" name="AgreeToRequirements" /></a>Open Facebox By Checking The Box </div> 
+4
source share
1 answer

id attribute is invalid. It should just be TEST10

Checkout jsFiddle Update Demo

 <div id="TEST10" style="display: none;"> HEYYYY! <br /> <br /> heyyyyy! </div> 
+6
source

Source: https://habr.com/ru/post/1393258/


All Articles