How to clear the contents of the div tag through javascript when click the close button?. This is the full code in header. <script type="text/javascript"> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loading_image : 'loading.gif', close_image : 'closelabel.gif' }) }) </script> Code (markup): Contents: <a href="#mobile" rel="facebox"> <img src="mobile.png"> </a> <div id="mobile" style="display:none;"> Dynamic content by php code. </div> Code (markup):
Iam not expert in javascript. I have added like below <script type="text/javascript"> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loading_image : 'loading.gif', close_image : 'closelabel.gif' $("#mobile").html(""); }) }) </script> Code (markup): Is it right?
nope.. it should be... <script type="text/javascript"> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loading_image : 'loading.gif', close_image : 'closelabel.gif' }); $("#mobile").html(""); }) </script> Code (markup):