HTML
CSS
JavaScript
HTML
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>文本框 - 可展开文本框</title>
  <link rel="stylesheet" href="https://cdn.w3cbus.com/library/mdui/1.0.2/css/mdui.min.css"/>
</head>
<body>

  <div class="mdui-container">
    <div class="mdui-textfield mdui-textfield-expandable">
      <button class="mdui-textfield-icon mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">search</i></button>
      <input class="mdui-textfield-input" type="text" placeholder="Search"/>
      <button class="mdui-textfield-close mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">close</i></button>
    </div>

    <div class="mdui-textfield mdui-textfield-expandable mdui-float-right">
      <button class="mdui-textfield-icon mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">search</i></button>
      <input class="mdui-textfield-input" type="text" placeholder="Search"/>
      <button class="mdui-textfield-close mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">close</i></button>
    </div>
  </div>

  <script src="https://cdn.w3cbus.com/library/mdui/1.0.2/js/mdui.min.js"></script>
</body>
</html>
CSS

  
JavaScript