我目前在javascript中有以下数组
var chart1data = [
{ "Time": "1", "Temperature": 60, },
{ "Time": "2", "Temperature": 50, },
{ "Time": "3", "Temperature": 42, },
{ "Time": "4", "Temperature": 35, },
{ "Time": "5", "Temperature": 28, },
{ "Time": "6", "Temperature": 24, },
{ "Time": "7", "Temperature": 21, },
{ "Time": "8", "Temperature": 19, },
{ "Time": "9", "Temperature": 18, },
{ "Time": "10", "Temperature": 18, },
];
我的 HTML 中有一个按钮,当按下该按钮时,应将上述数组中的值“60”更改为另一个数字(例如 - 80)
该按钮链接到此功能。我怎样才能使它起作用?
function updatechart (){
//This gets the number from a text box
var inputdata1 = document.getElementById("textbox1").innerHTML
//Now I need the code to put this number in replace of the value "60"
}