jquery attribute indexOf

Posted by Victor on Stack Overflow See other posts from Stack Overflow or by Victor
Published on 2010-06-17T21:16:11Z Indexed on 2010/06/17 21:43 UTC
Read the original article Hit count: 226

Filed under:
|

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

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


});

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

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

     }
}

What would I need to modify so that indexOf is working properly?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery