Aurangajeb

Disable text input field and show alert with jquery

Dec 4th, 2020 (edited)
768
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function( $ ){
  2.     // Your code in here
  3.     $( "#text" ).prop( "disabled", true );
  4.       $(document).on('click',function(e){
  5.         if(e.target.id == "text"){
  6.           alert("The input field is disabled.");
  7.         }
  8.       });
  9. });
RAW Paste Data