大家好,感謝您的關注。從html文檔中調用函數不會生成警報
我試圖調用一個JavaScript函數,當我點擊更新按鈕。
這裏是JavaScript
var text2Array = function() {
// takes the value from the text area and loads it to the array variable.
alert("test");
}
和HTML
<button id="update" onclick="text2Array()">Update</button>
,如果你想看到所有的代碼檢查出這個的jsfiddle http://jsfiddle.net/runningman24/wAPNU/24/
我試圖使函數全球,沒有運氣,我可以得到警報工作從HTML,但由於某種原因,它不會調用函數?
感謝的快速反應這做到了。 – urock24