This is just a quick tutorial (more of a code snippet) for creating a very simple plugin for jQuery.
Of course, there are lots of tutorials around for this, this is mainly for reference
$.fn.myFunction = function()
{
    // use the following loop to iterate through all objects
    // returned by the jQuery selector which was used
    return [...]

Tags: ,