i am using the following javascript function
window.onload = ajaxreq;
function ajaxreq()
    {
        test = document.getElementsByClassName("test_button")
         for (var i =0;i<test.length;i++)
     {
         test1 = test[i];
         if(test[i].onclick == true)
         {
            alert("i")
             }
     }
    }
but it alerts nothing Please tell me how to get the value of i for the element clicked
