The button inside tooltip does’t have any action when clicked, even set onclick event. Here is an example below,
JavaScript
x
15
15
1
tooltip: {
2
useHTML: true,
3
formatter: function() {
4
return '<div>' + this.point.date
5
+ '<br><span>$' + this.y
6
+ '</span><br><button onclick="testAlert()">test test test</button></div>';
7
},
8
},
9
10
11
12
function testAlert() {
13
alert('test');
14
};
15
Advertisement
Answer
Change pointer events property of the tooltip to 'auto'
.
JavaScript
1
11
11
1
tooltip: {
2
// pointFormat: '<div>{point.date}<br>{point.air}<br>${point.y}</div><button>test</button>',
3
useHTML: true,
4
formatter: function() {
5
return '<div>'+this.point.date+'<br>'+this.point.air+'<br><span>$'+this.y+'</span><br><a href="http://www.w3schools.com">testtesttest</a></div>';
6
},
7
style: {
8
pointerEvents: 'auto'
9
}
10
},
11