如何使用 jQuery 設定文字區域的內容?


單擊 <a> 標記時,內容將顯示在文字區域內。

示例

 線上演示

<script type="text/javascript">
   $(document).ready(function () {
      $("a").click(function () {
         $("#txt1").val("I AM DISPLAYING IN THE TEXTAREA");
      });
   });
   </script>
<body>
<div>
<a id="quiresweb" class="webclass" href="#">Quires</a><br />
<label id="lbl">TEXTAREA ::</label>
<textarea id="txt1" rows="5" cols="20"></textarea><br />
</div>
</body>

更新: 21-6 月-2020

2K+ 瀏覽次數

開啟您的 事業

參加課程獲得認證

開始學習
廣告
© . All rights reserved.