0
我想知道如何通過java腳本爲給定的canvas元素設置圖表單擊屬性。我試着做設置Chart-click屬性的角度圖
angular.element(document.getElementById(id))[0].attributes[attributeName].value =value;
但我沒有幫助。 我想我錯過了一些與綁定有關的東西。
我想知道如何通過java腳本爲給定的canvas元素設置圖表單擊屬性。我試着做設置Chart-click屬性的角度圖
angular.element(document.getElementById(id))[0].attributes[attributeName].value =value;
但我沒有幫助。 我想我錯過了一些與綁定有關的東西。
您可以使用本機addEventListener屬性以編程方式將點擊屬性添加到DOM元素。這是可以做到像這樣:
document.getElementById(id).addEventListener('click', function(){
//The function to be called on click
})
欲瞭解更多信息see here