How to write a generic routine to enable disable control nested in page by jquery
===

i know how to enable or disable control using jquery one-by-one
suppose if i need to enable/disable hyperlink then i can write code like

    a.disabled { color:gray; }
    $(document).ready(function() {
    $('a.something').click(function(e) {
        e.addClass('disabled');
        e.preventDefault();
    });
    });


suppose if i need to enable/disable textboxes then i can write like

     $("#textbox1").attr("disabled", "disabled"); 
     $("#textbox1").removeAttr("disabled"); 

suppose i need to enable or disable many controls in my page like
5 textboxes one button and few hyperlink inside a div.

i want to write a jquery function where i will pass a block like
here i will explain my control position or hierarchy 

    {
      textbox1,
      textbox2,
      textbox3,
      Button1,
      #dv1.div>ul>li></a>
    }

so i want to pass the above block to a function and that function will enable / disable control in pages. if anything similar like possible then please discuss here. thanks


