The example of this article describes the method of implementing the tag sticky effect of jquery. Share to everyone for your reference. The implementation methods are as follows:
The HTML code is as follows:
Copy Code code as follows:
<script type= "Text/javascript" src= "Js/jquery.js" ></script> <!--jQuery Reference code-->
<script type= "Text/javascript" src= "Js/delrepeat.js" ></script> <!--to achieve the heavy JS code-->
<body>
<input id= "Repeatvalue" type= "text" onblur= "Delrepeat ()" >
</body>
The Delrepeat.js code is as follows:
Copy Code code as follows:
function Delrepeat () {
var str = $ (' #repeatValue '). Val ();
var strarr=str.split ("");//Divide the string into an array by space
var uniquearr = [];
$.each (Strarr, function (i, EL) {
if ($.inarray (el, Uniquearr) = = 1) uniquearr.push (EL);
});
$ (' #repeatValue '). Val (Uniquearr.join ("")); And then combine the strings
}
I hope this article will help you with your jquery programming.