user1124535
user1124535

Reputation: 845

Matching Regex in Document

If location.href.match(i) matches in the URL,

how do you use javascript to match for something throughout the entire document without jquery?

Upvotes: 0

Views: 3274

Answers (1)

Teemu
Teemu

Reputation: 23406

Try this: res=document.body.innerHTML.match(i);. And if you want include the head part of the document: document.documentElement.innerHTML....

Upvotes: 2

Related Questions