Luarb Balla Luarb Balla - 2 years ago 110
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>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download