How do I handle elements injected via ajax?None of these work:\[code\]$("#regsitrationform").hide();$("#register h2").hide();\[/code\]I can handle on click events, but these, how do I handle simple jQuery actions?ajax:\[code\]//Show levels using ajax//define variablesvar levels = 2; //level count can be rewritten to come from DB and not be hardcoded like nowvar completed_calls = 0; //On last task we sort views, append, and activate slidervar views = new Array();//All level display ajax functionfunction create_views(level) { $.ajax({ url: "actions.php", type: "GET", data: "show_level=" + level, cache: false, success: function (data){ views[level] = '<li data-level="' + level + '">' + data + '</li>'; //Count completed tasks completed_calls++; //if last level is being called via ajax: sort li, append and activate slider if (levels == completed_calls) { //sort li by data-level views.sort(function(a,b){ return parseInt($(a).attr('data-level')) > parseInt($(b).attr('data-level')); }); //append views to container $(".slides_container").append(views); //activate slider var unislider = $(".slides_container").dpUniSlider({ //loop: false, draggable: false }); } } });}//Loop through all levels and display viewsfor (var i=1; i<=levels; i++) {create_views(i);}\[/code\]full code that needs operates after ajax call and doesn't work:\[code\]//Login and Registration windows on login slide, one closes the other opens up//+ login registration links in header for logged out users //Login $("#header-login, #logwindow").on("click", function(){ $("#regsitrationform").hide(); $("#register h2").hide(); $("#loginform").show().css("opacity",0); unislider.goToSlide(2); $("#loginform, #register h2").delay(480).fadeTo(0, 1); $("#logwindow").removeClass("active").addClass("notactive"); $("#regwindow").removeClass("notactive").addClass("active"); return false; }); //Registration $("#header-register, #regwindow").on("click", function(){ $("#loginform").hide(); $("#register h2").hide(); $("#regsitrationform").show().css("opacity",0); unislider.goToSlide(2); $("#regsitrationform, #register h2").delay(480).fadeTo(0, 1); $("#regwindow").removeClass("active").addClass("notactive"); $("#logwindow").removeClass("notactive").addClass("active"); return false; });//Pop-up logo tooltip: close $(".close").on("click", function(){ $(".logo").fadeTo("slow", 1); $(this).parent().fadeOut("fast"); return false; });//Pop-up logo tooltip: clear $(".clear").on("click", function(){ $(this).parent().find("input").val(""); return false; });//Banner rotation if ($("#ads").length > 0) { rotate_banner(); function rotate_banner() { $("#ads a:nth-child(1)").delay(30000).animate({opacity: 0, width: 0}, "slow", function(){ $("#ads a:nth-child(3)").css("opacity","0").animate({opacity: 1}, "slow"); $(this).appendTo("#ads").removeAttr("style"); rotate_banner(); }); } }//Activate Georgian keyboard for some logos $("input[data-lang=ge]").GeoKBD();\[/code\]And the console.dir output of the variable views: