Just chain .test () after after .html.
$('#div').html('blub').test();
To achieve this, just create a small plugin.
Like this (jsFiddle example) :
jQuery.fn.test = function() {
return this.each()};
This return is necessary because the method should return a jQuery object, unless otherwise specified explicitly for the jQuery plugin. Read about jQuery plugins here .
source
share