Modal does not work in iOS

hi all, I have a messenger type user interface whose html code looks like below

DDD <a class=“xxx”; (click)=‘openModal()’>YYY.

my openModal() function looks as below

var test=this;
var modal=this.modal;

  var x = document.getElementsByClassName("xxx");
  addEventListener('click', function(e){ 
    if ((<HTMLInputElement>!=undefined && (<HTMLInputElement> == 'A') {
      var image = (<HTMLInputElement>'class');
      if(image.split(" ")[0]=="yyy")
       const myModalPage = modal.create("yyy");
      const myModalPage = modal.create("xxx");
  }, false);
  console.log("binding the event")

this works fine on browsers and android phones, but does not work in iPhones, what’s the problem ?