Name

search() — NN 4 IE J3 ECMA n/a

Synopsis

search(regexpression)

Returns the zero-based indexed value of the first character in the current string that matches the pattern of the regexpression parameter. This method is similar to the indexOf() method, but the search is performed with a regular expression rather than a straight string.

Returned Value

Integer.

Parameters

regexpression

A regular expression object. See the regular expression object for the syntax to create a regular expression object.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.