如何在谷歌可视化表中单击相应的列名称/标题时获取列名称(标题)?
:- use_module(library(lambda)).
mostcommon_in(E,Xs) :-
tcount(=(E),Xs,M),
maplist(Xs+\X^N^(tcount(=(X),Xs,N)),Xs,Counts),
reduce(\C0^C1^C^(C is max(C0,C1)),Counts,M).
答案 0 :(得分:1)
在jQuery中
$(".google-visualization-table-th").click(function(e){
alert("You selected column: " + e.toElement.innerText);
});
在纯JS中
var h = document.getElementsByClassName("google-visualization-table-th");
for (i = 0; i < h.length; i++) {
h[i].addEventListener("click", function (e) {
alert("You selected column: " + e.toElement.innerText);
}, false);
}
在此处查看您的更新小提琴:http://jsfiddle.net/xj3ww79n/4/