let a = document.createElement('a');
a.href = 'http://www.google.com';
document.getElementsByTagName('body')[0].appendChild(a);
console.log(a);
a.click();
I use this code to test document.click() event,but a.click() can not trigger in Ionic3
It’s usable in Angular5
why?
If you want to open in new page/tab use => window.open(‘http://www.google.com’, 'blank);
If you want to use the current page/tab use => window.location.href = ‘http://www.google.com’;