0

I trigger a click event when clicking on another button using jQuery(".Classname").click(), but it is not working using Safari on iPhone.

Example:

jQuery(".button1").click(function(){
  jQuery(".button2").click();
})  
Drenmi
  • 8,492
  • 4
  • 42
  • 51
Sourabh
  • 500
  • 2
  • 14

2 Answers2

0

try use .trigger() method.

jQuery(".button1").click(function(){
  jQuery(".button2").trigger("click");
}) 
Alien
  • 3,658
  • 1
  • 16
  • 33
0

Add the CSS fix to your button,

.button2 {
   cursor:pointer;
}

Consider this is an tip; if the element is not bound using $.click() use the DOM object like

jQuery(".button1").click(function(){
  jQuery(".button2")[0].click(); // or .get(0).click();
}) 
Adam Azad
  • 11,171
  • 5
  • 29
  • 70