jQuery Mobile: URL y contraseña de Textinput

Descripción

url inputtype acepta solo el valor de URL. Este tipo se utiliza para campos de entrada que deben contener una dirección URL.

password input type se utiliza para crear un control de texto oculto, es un campo para información confidencial.

Ejemplo

El siguiente ejemplo demuestra el uso de la entrada de URL y contraseña en jQuery Mobile.

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
   </head>
   
   <body>
      <form>
         <h2>URL Input Example</h2>
         <label for = "src">URL Input</label>
         <input type = "url" id = "src" data-clear-btn = "false">
         
         <label for = "src1">Clear the URL Field</label>
         <input type = "url" data-clear-btn = "true" id = "src1">

         <h2>Password Input Example</h2>
         <label for = "src2">Password Input</label>
         <input type = "password" id = "src2" data-clear-btn = "false">
         
         <label for = "src3">Clear the Password Field</label>
         <input type = "password" data-clear-btn = "true" id = "src3">
      </form>
   </body>
</html>

Salida

Realicemos los siguientes pasos para ver cómo funciona el código anterior:

  • Guarde el código html anterior como textinput_url_password.html archivo en la carpeta raíz de su servidor.

  • Abra este archivo HTML como http: //localhost/textinput_url_password.html y se mostrará el siguiente resultado.