SoFunction
Updated on 2025-03-03

The solution to the object does not support indexOf attribute or method (must read)

var divarr = ["a","b","c","d"];

Determine whether a exists in the divarr array

("a")==-1    Under ie8, it will prompt that the object does not support indexOf attribute or method

Solution:

Replace indexOf with $.inArray in jquery

$.inArray(“a”, divarr)==-1

The above object does not support indexOf attributes or methods (must read) is all the content I share with you. I hope you can give you a reference and I hope you support me more.