jQuery global expansion method

<! DOCTYPE HTML > 
<HTML>
<head>
<Meta charset = "UTF-. 8" >
<title> 01-expansion method of the jQuery object </ title>
<Script the src = "../js/jquery-3.3.1 .min.js " type = " text / JavaScript " charset = " UTF-. 8 " > </ Script>
<Script type = " text / JavaScript " > 2 @ th global way to extend the method, expansion methods min: seeking 2 a minimum value; method extension max: maximum value find 2 $. extend ({ max: function (a , B) { // return a large number of values in the two return a> = b a:? B ; } , min:function (a,b) {return a <=b ? a:b







;
}
}) ; // call the global method var max = $. Max ( . 3 , . 4) ; // Alert (max); var min = . $ Min ( . 8 , 0) ; Alert (min) ; </ Script> </ head> <body> </ body> </ HTML>












Guess you like

Origin www.cnblogs.com/newcityboy/p/11525196.html