How do I display the value of a variable in javascript in an alert box?
(如何在警告框中的javascript中显示变量的值?)
For example I've got a variable x=100 and alert(x) isn't working.
(例如,我有一个变量x = 100而alert(x)不起作用。)
the script used in grease monkey is here
(油脂猴子使用的脚本就在这里)
var inputs = document.getElementsByTagName('input');
var new;
for (i=0; i<inputs.length; i++) {
if (inputs[i].getAttribute("name") == "ans") {
new=inputs[i].getAttribute("value"));
alert(new)
}
}
ask by technocrat translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…