MJ Info’s Animated Required Fields Validation

Select option constantly blink when doesn’t field. And you can also follow JQuery if else condiotion.

<!DOCTYPE html>
<html lang="en" >
   <head>
      <meta charset="UTF-8">
      <title></title>
      <style>
         .blinkanimat {
         animation: blinker 1s linear infinite;
         }
         select.blinkanimat.open{
         animation: inherit;
         }
         @keyframes blinker {
         50% {
         opacity: 0;
         }
         }
      </style>
   </head>
   <body>
      <select class="blinkanimat">
         <option value="">Select</option>
         <option value="a">A</option>
         <option value="b">B</option>
         <option value="c">C</option>
      </select>
      <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js'></script>
      <script>
         $('.blinkanimat').on('click', function () {
             var numberX = $(this).val();
         
             if (numberX == '') {
                 $(this).removeClass('open');
             } else {
                 $(this).addClass('open');
             }
         });
      </script>
   </body>
</html>

administrator

Leave a Reply

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