调用与按钮属性匹配的函数

时间:2021-01-25 18:49:05

Using TypeScript how can I trigger a function matching the onclick attribute.

使用TypeScript如何触发匹配onclick属性的函数。

<button onclick="window.open('myapp://', '_system')">Goto App</button>

So that means whenever someone clicks on button above, I will call a JavaScript function to take the user to www.google.com

这意味着只要有人点击上面的按钮,我就会调用JavaScript函数将用户带到www.google.com

Please note that I don't have control over this button or else It would have attached a method on the onclick.

请注意,我无法控制此按钮,否则它会在onclick上附加一个方法。

1 个解决方案

#1


2  

I don't have control over this button

我无法控制这个按钮

#1


2  

I don't have control over this button

我无法控制这个按钮