按钮被禁用,但是只要我在textArea中写了一些按钮就不启用了!
我的代码:
function teste(){
btnEnviar = document.getElementById('btnAnalisarImagem');
txtAreaInserirURLImagem = document.getElementById('inserirURLImagem').value;
if(!txtAreaInserirURLImagem){
return btnEnviar.disabled = true;
} else {
return btnEnviar.disabled = false;
}
}
答案 0 :(得分:0)
您需要在内容更改时再次调用您的函数,通常是通过处理keyup
之类的事件或(以处理其他更改,如粘贴)input
。
答案 1 :(得分:0)
您需要像这样添加此代码段
let obj={
"name": "Retail Sales",
"weight": 10,
"length": 6,
"type": "retailSales",
"rows": [
{
"dealerEvaluationHistoryID": 0,
"performanceDealerMappingDetailID": 14,
"month": 1,
"plan": 0,
"actual": 0,
"weight": 0,
"pelanggaranWilayah": 0
},
{
"dealerEvaluationHistoryID": 0,
"performanceDealerMappingDetailID": 14,
"month": 2,
"plan": 0,
"actual": 0,
"weight": 0,
"pelanggaranWilayah": 0
},
{
"dealerEvaluationHistoryID": 0,
"performanceDealerMappingDetailID": 14,
"month": 3,
"plan": 0,
"actual": 0,
"weight": 0,
"pelanggaranWilayah": 0
}
]
}
let array=obj.rows.map(function(row){
return [row.month,row.plan,row.actual,row.weight];
});
console.log(JSON.stringify(array));