| mikezilla.com

Removing Blocks of HTML using Regular Expressions

[ie, gecko]

When processing HTML using Javascript you often want to remove not only the tags but everything inbetween as well. This example shows how to do this with a regular expression. A function is used that is passed the source HTML as a string and the tag name of the block to remove.

Block type to remove: e.g. script, style, p