I want to run a function when elements of a certain class are loaded and clicked… so something like:
$(".blah").on("load,click", function() {
// do stuff
})
but it seems that the load event is not an event (maybe?). What’s the best way to get the function to run on click and on load?
You could trigger the click on document ready:
From the jQuery documentation for
load: