Home  >  Article  >  Web Front-end  >  csdn forum technical area average score function_javascript skills

csdn forum technical area average score function_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:42:221019browse

1 Average points will be given to each person (repeated replies will only be given one point):
javascript:var t=function(tag,s) { return (s ||document).getElementsByTagName(tag);};var n=function (name){return document.getElementsByName(name)};var total=t("var")[0].innerHTML-0;var scores=n("tb_score");var lz=t("a",t ("var")[0].parentNode)[0].innerHTML;var c={};c[lz]=lz;for(var i=0;i
Source code:

Copy code The code is as follows:

var t=function(tag,s) { return (s ||document).getElementsByTagName(tag);};
var n=function(name){return document.getElementsByName(name)};
var total=t("var")[0].innerHTML-0;
var scores=n("tb_score");
var lz=t("a",t("var" )[0].parentNode)[0].innerHTML;
var c={};
c[lz]=lz;
for(var i=0;i var v=t("a",scores[i].parentNode)[0].innerHTML;
if(!c[v]) {
c[v]=v;
scores[i].value=scores[i].value-0 1;
total--;
if(total==0)break;
}
if(i==scores .length-1){i=-1;c={};c[lz]=lz;}
};
alert("ok");

2 each The average floor score:
javascript:var t=function(tag,s) { return (s ||document).getElementsByTagName(tag);};var n=function(name){return document.getElementsByName(name) };var total=t("var")[0].innerHTML-0;var scores=n("tb_score");var lz=t("a",t("var")[0].parentNode) [0].innerHTML;for(var i=0;i
Source code:
Copy code The code is as follows:

var t=function(tag,s) { return (s ||document).getElementsByTagName(tag);};
var n=function(name){return document.getElementsByName(name)};
var total=t("var")[0].innerHTML-0;
var scores=n("tb_score");
var lz=t("a",t("var") [0].parentNode)[0].innerHTML;
for(var i=0;i if(t("a",scores[i].parentNode)[ 0].innerHTML!=lz) {
scores[i].value=scores[i].value-0 1;
total--;
if(total==0)break;
}
if(i==scores.length-1)i=-1;
};
alert("ok");

Explanation: Change the above Just put the code in the address bar of the post closing page and press Enter. Only use it once, otherwise negative points will occur.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn