I need to implement a simp^le “find” function which will retrieve the 1st occurence of a given string, then find next occurrences on demand.
Please no jQuery, only good plain javascript.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use
window.find()that the browser offers. See here for more info.This is supported in Firefox and WebKit. For IE, there is a work-around here using the
findText()method of aTextRangeobject.