「MediaWiki:Common.js/ParserFunctions.js」の版間の差分
提供: Yourpedia
細 |
細 (一旦差し戻し) |
||
18行目: | 18行目: | ||
if(numA && numB && numC){ | if(numA && numB && numC){ | ||
numC.innerText = Number(numA) + Number(numB); | numC.innerText = Number(numA) + Number(numB); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
break; | break; | ||
} | } |
2019年6月7日 (金) 02:25時点における版
/* Any JavaScript here will be loaded for all users on every page load. */ /* 計算スクリプト */ var Keisans = document.getElementsByClassName('tashizan'); var Childs; var numA; var numB; var numC; for(var i in Keisans){ Childs = Keisans[i].childNodes; for(var i2 in Childs){ if(Childs[i2].className == 'numA') numA = Childs[i2].innerText; if(Childs[i2].className == 'numB') numB = Childs[i2].innerText; if(Childs[i2].className == 'numC') numC = Childs[i2]; if(numA && numB && numC){ numC.innerText = Number(numA) + Number(numB); break; } } } // END