The DOM is known var J_top_bar = document.createelement ("div"); J_top_bar.style.cssText = ' Position:fixed;left:100px;top:100px;background-color: #fff; color: #000;p adding:10px; border:2px solid #09f; '; Document.body.appendChild (J_top_bar); J_top_bar.setattribute ("DATA-XL", 1); j_top_bar.innerhtml = ' 1 '; Js function A (argument) { Do not have to simulate, trapped for var that = this; if (!that._mark) { That._mark = 1; Manipulating Dom that.innerhtml = that.innerhtml * 1 + 1; That.setattribute ("XL", That.getattribute ("XL") * 1 + 1); } Delete that._mark;//Remove logo } //$ function B (argument) { Simulate each click, because click inside to use $this = this; var $this = JQuery (this); if (! $this. Data ("Mark")) { $this. Data ("Mark"); Manipulating Dom $this. html (function (I, Val) { Return val * 1 + 1; }). attr ("Data-xl", $this. attr ("DATA-XL") * 1 + 1); } $this. Data ("Mark", 0);//Remove logo } var start = new Date-0; Console.time ("Dom"); for (var i = 0;i<10000;i++) { A.call (J_top_bar); } Console.timeend ("Dom"); Alert ("Dom:" + (new Date-0)-start) start = new Date-0; Console.time ("$"); for (var i = 0;i<10000;i++) { B.call (J_top_bar); } Console.timeend ("$"); Alert ("$:" + ((new Date-0)-start) |