I am trying to trigger a scroll event on the select tag which is being formed dynamically based on the AJAX response. Tried different approaches and nothing seems to work Tried triggering the scroll event inside a ready() in the following ways.
$(document).on("scroll", ".selectClass", function(event) {
console.log("Into document scroll");
});
$(".selectClass").scroll(function(event) {
console.log("Into scroll event");
});
$('select[id^="selectID_"]').on('scroll', function(event){
console.log("Into scroll event based on id");
});
Tried putting it in the window.load() as below
$(window).load(function(){
alert("window is loaded");
$(".selectClass").scroll(function(event) {
console.log("Into scroll event of onload");
});
Also tried putting these scroll events in script tag at the end of the body but the event is not getting triggered.
But the scroll event gets triggered when tried any of the above approaches from browser console.
Could anyone please help me.