Luarb Balla Luarb Balla - 1 year ago 63
jQuery Question

How to use custom function in jquery chaining

Is it possible to make something like this:

function hideThisObject(objectName){


Answer Source

You need to use jquery $.fn.* to declaring jquery custom function.

$.fn.customFunc = function(){
    $(this).css("background-color", "green");

div {
    width: 100px;
    height: 100px;
    background: red;
<script src=""></script>