And so, the problem is:
There is a mobile site. On it jq. There are two buttons that are in different positions in the DOM. something like this:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="content"> <ul class="table-view"> <li class="promt"> <a class="icon icon-right-nav" style="font-size: 14px;">Подсказка</a> </li> </ul> <div class="content-padded"> <a id="answer">Решение</a> </div> <script> $(document).ready(function(){ $(document).on('click', 'li', function(){ alert($(this).attr('class')); }); $(document).on("click", "#answer", function(){ alert($(this).attr('class')); }); }); </script> </div>
So, it works in the browser from the desktop, but not from the phone. BUT! The handler for the #answer
button works like a clock! Only .promt
does not work. How to be?