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,267
  • 4
  • 40
  • 51
Sourabh
  • 490
  • 2
  • 13

2 Answers2

0

try use .trigger() method.

jQuery(".button1").click(function(){
  jQuery(".button2").trigger("click");
}) 
Alien
  • 3,620
  • 1
  • 15
  • 32
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
  • 10,915
  • 5
  • 26
  • 67