I have a div with the identifier "close" inside a dynamically created div with the identifier "box". The following code is designed to do something whenever the user clicks on the close button.
$('#box').on('click','#close',function(){ alert(1);
I use CMS Big Cartel, and if I click "in preview mode", it works fine, but every time I actually publish a site and view it normally, it does absolutely nothing - no mistakes - nada.
Markup and CSS, just in case:
<div id="box"> <div id="close"></div> <h2 id="name"></h2> <div id="description"> <p>blah...</p> </div> </div> #close{ background: url(image-path); float: right; position: relative; top: 0; margin: 0 0 0 12px; width: 25px; height: 25px; cursor: pointer; z-index: 100; }
What am I missing?
source share