
Laravel onclick function not working
There could be any reason that laravel onclick function not working in your case. Here we provide code snippet on onclick event which helps you to find out the solution for your problem
Answers 2
-
Get data-id attribute value using onclick event on button in javascript
<button data-id="5" onclick="followUser(this); return false;">Follow</button> <script> function followUser(e){ var id = e.getAttribute('data-id'); console.log(id); } </script>
0This code snippet will help you to get the value of data-id attribute using onclick event on button in javascript.
-
JQuery get data id attribute value on click button
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <button type="button" data-id="5" id="Button">Follow</button> <script> $(document).ready(function(){ $('#Button').on('click', function(){ var value = $(this).attr('data-id'); alert(value); console.log(value); }); }); </script>
0
Random Code Snippet Queries: Laravel
- The use statement with non-compound name 'Auth' has no effect
- Drop foreign key column in Laravel using migration
- Remove public from url in laravel project
- Ajax GET request in laravel
- Trying to get property 'title' of non-object
- Add a subselect based on relationship using withAggregate method
- How to get the id of last record from collection object in laravel view
- How to get tomorrow and yesterday date in laravel
- Root composer.json requires php ^7.3 but your php version (8.0.0) does not satisfy that requirement
- Laravel 5.4 save data to database
- How to include header file in laravel
- Generate random string lowercase in Laravel
- How to get records in random order in laravel
- External link not working in laravel blade
- Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given
- How to pass data to route in laravel?
- How to make Copy or Duplicate table row in laravel
- How to pass query string with pagination in laravel
- Laravel get count with where condition
- Ajax POST request in laravel
- Create records using relationship in laravel
- How to customize pagination view in laravel
- Call to a member function pluck() on array
- Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()
- Laravel hasmany select not working