jQuery jQuery.htmlPrefilter () method
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字符串上进行操作 |
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.