jquery attribute indexOf
<p>When I am getting at an attribute <code>onclick</code> of custom(Reporting Services) checkbox it gives me correct result. However when I am trying to use <code>indexOf</code> on that result it says "Object doesn't support this property or method", i.e. this is fine, gives me a long string</p>

<pre><code>$('input[id*=CustomCheckBox]').click(function()
{
      alert( $(this).attr("onclick") );


});
</code></pre>

<p>But this gives an error(object doesn't support this property or method):</p>

<pre><code>$('input[id*=CustomCheckBox]').click(function()
{
     if ($(this).attr("onclick").indexOf("SomeString") &gt; -1 )
     {
          //do some processing here

     }
}
</code></pre>

<p>What would I need to modify so that <code>indexOf</code> is working properly?</p>
