需要简单JavaScript HTML DOM函数的帮助
我想做一个回调函数, 离开输入窗体-->后,调用函数更改文本输入的背景颜色。。 但它不起作用需要简单JavaScript HTML DOM函数的帮助,javascript,html,dom,Javascript,Html,Dom,我想做一个回调函数, 离开输入窗体-->后,调用函数更改文本输入的背景颜色。。 但它不起作用 function makeBig() { var y = document.getElementById("myText"); y.value = y.value.toUpperCase(); function colorInput(y) { y.style.background = "yellow"; } }您的makeBig()函数声明函数
function makeBig() {
var y = document.getElementById("myText");
y.value = y.value.toUpperCase();
function colorInput(y) {
y.style.background = "yellow";
}
}
您的makeBig()函数声明函数colorInput(y),但从不调用它。更改:
function colorInput(y) {
y.style.background = "yellow";
}
到
您的makeBig()函数声明函数colorInput(y),但从不调用它。更改:
function colorInput(y) {
y.style.background = "yellow";
}
到
函数makeBig(){
var y=document.getElementById(“myText”);
y、 value=y.value.toUpperCase();
y、 style.background=“黄色”;
}
函数makeBig(){
var y=document.getElementById(“myText”);
y、 value=y.value.toUpperCase();
y、 style.background=“黄色”;
}