skip to Main Content

Unbind class selector jquery after changing class of a div

I am dynamically altering the class of a div when ajax request completes. <div id="MyDiv1" class="oldclass">Age</div> Inside the success function of ajax request : $('.oldclass').click({ alert('I am old'); }); $('.youngclass').click({ alert('I am young'); }); $.ajax({ ........ success: function(){ $('#MyDiv1').removeAttr('oldclass'); $('#MyDiv1').addAttr('youngclass');…

VIEW QUESTION

Hide elements with jquery

I would like to hide individual element blocks that are identified by id`s. I have used a jquery function to do this. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name=”apple-mobile-web-app-capable” content=”yes “> <script type="text/javascript" src="http://code.jquery.com/jquery-3.7.1.min.js"></script> <script> function changeMenu(menu){ $('#Slide_home').css({'display':'none'}); $('#Slide_sub01').css({'display':'none'});…

VIEW QUESTION
Back To Top
Search