var str = "Visit W3Schools!"; var n = str.search("W3Schools"); //returns de position of the match, form 0 to ... If returns -1 means that there is no match