Onclick event on touch screen

0

I am developing a project in laravel 5.5, the problem is that when I want to unlock and run the onclick event on a touch screen, I do not run it. How can I do it so that it runs on a touch screen?

here is the code

<li>
       <ahref="{{ route('logout') }}"
       onclick="event.preventDefault();
                document.('logout-form').submit();">
       Salir
   </a>

   <form id="logout-form" action="{{ route('logout') }}" method="POST"                                       style="display: none;">
       {{ csrf_field() }}
   </form>
</li>
    
asked by Jean Carlos Hernandez 06.12.2017 в 19:35
source

1 answer

1

So I have it and it works:

<li>
     <a href="{{ route('logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
          Salir
     </a>
     <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
          {{ csrf_field() }}
     </form>
</li>
    
answered by 07.12.2017 / 08:04
source