jQuery Mobile - 隱藏文字輸入標籤



描述

ui-hidden-accessible 類用於隱藏標籤。

示例

以下示例演示了在 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>Label hidden Example</h2>
         <label for = "src" class = "ui-hidden-accessible">Label Hidden Text Input</label>
         <input type = "text" id = "src">

         <label for = "src1" class = "ui-hidden-accessible">Clear the label hidden text Field</label>
         <input type = "text" data-clear-btn = "true" id = "src1">

         <label for = "src2" class = "ui-hidden-accessible">Label Hidden Search Input</label>
         <input type = "search" id = "src2">

         <label for = "src3" class = "ui-hidden-accessible">Label Hidden Textarea </label>
         <textarea type = "textarea" id = "src3"></textarea>
      </form>
   </body>
</html>

輸出

讓我們執行以下步驟來了解以上程式碼如何工作 -

  • 將上面 html 程式碼另存為 textinput_label_hidden.html 檔案,放在伺服器根資料夾中。

  • 以 https:///textinput_label_hidden.html 的形式開啟此 HTML 檔案,將顯示如下輸出:

jquery_mobile_widgets.htm
廣告
© . All rights reserved.