IT Consultant and App Development

Memuat Halaman

Download Source Code

Menampilkan Password

Source Code <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <div style="padding: 10px"> <p>Password</p> <div> <input type="password" name="password" class="password" placeholder="Tulis Password" /> </div> <div> <input type="checkbox" class="show-password" id="show-password" /> <label for="show-password">Tampilkan Password</label> </div> </div> <script type="text/javascript"> $(document).ready(function(){ $('.show-password').click(function(){ if($(this).is(':checked')){ $('.password').attr('type','text'); }else{ $('.password').attr('type','password'); } }); }); </script>