Latest web development tutorials

jQuery jQuery.htmlPrefilter () method

jQuery Misc Methods jQuery Misc Methods

Examples

Delete all from the incoming HTML string label

$ (Function () { var htmlPrefilter = $ htmlPrefilter, rdel = / <(del) (= [\ s?> [\ w \ W] * <\ / \ 1 \ s *> / gi.]);?. $ htmlPrefilter = function ( html ) { return htmlPrefilter. call ( this, html ). Replace ( rdel, "" );}; Var htm = '<del> deleted </ del> <h1> heading </ h2>'; $ ( 'body') append ($ htmlPrefilter (htm).);.});

try it"

Definition and Usage

$ .htmlPrefilter () Function to modify and filter HTML strings with jQuery methods of operation.


Notes: 1. This method rarely need to call, but you can use this method as a method of modifying an existing jQuery operating an entry point.


grammar

$.htmlPrefilter( html )

参数 描述
html String类型 在该HTML字符串上进行操作


Examples

More examples

Ensure that any HTML string XHTML compliant
Any HTML string XHTML compliant, remove all the <del> tag can also be solved from the incoming HTML string.


jQuery Misc Methods jQuery Misc Methods