Javascript doesn’t work in file blade Laravel

#ask Can anyone help me? I don’t understand why my script code doesn’t work.I want fill text input after click button and show alert but it’s not working.

In the app.blade.php file I have added this

      <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>MHYSA LEARNING</title>
    <div id="app">

       <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
        <main class="py-4">




this my payment.blade.php


   <div class="container">

       <table class="trip-informations">
                        <div class="container">
                             <form method="POST"  action="{{ route('') }}">
                                <div class="row align-items-start">
                                    <input class="col-4 widget-square1"style="font-weight: 300;font-size:16px;margin-left:5px;padding:5px" name="coupon_code" id="coupon_code">
                                      <button class="col-3 widget-square2"style="font-weight: 100px;font-size:10x;color:#fff" id="coupon_button"> Masukkan</button>




 <script type="text/javascript" charset="utf-8">
  $('#coupon_button').on('click', function(){

    var coupon_code = $('#coupon_code').val();



is there something wrong with my code because the test alert does not appear and filling input text after click button also doesn’t work

Source: JavaSript – Stack Overflow

August 14, 2021
Category : News
Tags: autofill | javascript | laravel | php | user-input

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.