Quick question. If I try to clear multiple divs with the same class, is there still a short jQuery for this? I tried $('.clearit').empty(); and doesn't seem to work at all (none of the sections with this class are cleared). Can I do it wrong or is it just not working? Let me know, I tried $('.clearit').html(''); . I also have this along with other code that runs after it in jquery, and everything else works as it should. I debugged the code and seemed to run the function without errors, but the contents of the div were not cleared. Here is an example of divs:
<center><div class="clearit" id="container2">Loading the player ...</div></center> </li> <li> <center><div class="clearit" id="container3">Loading the player ...</div></center> </li> <li> <center><div class="clearit" id="container4">Loading the player ...</div></center>
and here is the code for one of the handlers. Please pay attention to everything that works there, except for $('.clearit').html(''); .
$('.thumbNav li a').click(function(){ $('.clearit').html(''); var str = $(this).html(); var pattern = /[0-9]+/g; var matches = str.match(pattern); var myInteger = parseInt(matches);
THANKS TO THOSE FOR THOSE WHO HELP ME! I also changed the site so that you no longer need to log in so that you can see it in action for yourself. Please use the above code as a reference when searching for javascript. (Everything is in vid.php) Thanks
https://aliahealthcare.com/vid.php
Also, I just discovered something interesting. The upper part of li is part of ul with the slider id. When I do $('#slider').html(''); or $('#slider').empty(); It works, but it clears all divs, so players who load inside these divs do not load. All I have to do is just clear the players so that you cannot work with multiple players at the same time.
source share