RIRedinPA Posted January 28, 2011 Share Posted January 28, 2011 The return is a string, right? So I should be able to do a str.IndexOf("something") on it, right? var userlinks = $(".userlinks").html(); //var indexnum = userlinks.IndexOf("Filter Records"); console.log(userlinks); if (userlinks.IndexOf("Filter Records") == -1) { ... I keep getting: userlinks.IndexOf is not a function Quote Link to comment https://forums.phpfreaks.com/topic/225962-jquery-html-question/ Share on other sites More sharing options...
Adam Posted January 28, 2011 Share Posted January 28, 2011 That's because "IndexOf" isn't a function, "indexOf" is though. JS is case-sensitive. Quote Link to comment https://forums.phpfreaks.com/topic/225962-jquery-html-question/#findComment-1166606 Share on other sites More sharing options...
.josh Posted January 28, 2011 Share Posted January 28, 2011 also for good measure you can throw .toString() into the mix to ensure it is a string: Quote Link to comment https://forums.phpfreaks.com/topic/225962-jquery-html-question/#findComment-1166660 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.