jQuery動態添加及刪除表單上傳元素的方法(附demo源碼下載),jquerydemo

來源:互聯網
上載者:User

jQuery動態添加及刪除表單上傳元素的方法(附demo源碼下載),jquerydemo

本文執行個體講述了jQuery動態添加及刪除表單上傳元素的方法。分享給大家供大家參考,具體如下:

運行效果如下:

點擊此處查看線上示範效果。

具體代碼如下:

<html><head><script type="text/javascript" src="jquery-1.7.2.min.js"></script><script type="text/javascript">$(document).ready(function(){ $(":input[type=button][value=more]").bind("click",function(){ var $br = $("<br />"); var $file = $("<input type='file' name='name1' />"); var $button = $("<input type='button' value='delete'>"); $(this).after($file).after($button).after($br); $button.bind("click",function(){  $br.remove();  $file.remove();  $button.remove(); }) })});</script></head><body><input type="file" name="file1" /><input type="button" value="more" /></body></html>

完整執行個體代碼點擊此處本站下載。

希望本文所述對大家jQuery程式設計有所協助。

您可能感興趣的文章:
  • jQuery實現動態添加和刪除一個div
  • JQuery實現動態添加刪除評論的方法
  • JQuery動態添加和刪除表格行的方法
  • jquery動態添加刪除(tr/td)
  • Jquery動態添加及刪除頁面節點元素範例程式碼
  • jquery動態添加刪除一行資料樣本
  • js jquery分別實現動態檔案上傳操作按鈕的添加和刪除
  • jQuery動態添加、刪除元素的方法
  • jquery動態添加刪除div 具體實現
  • jquery 如何動態添加、刪除class樣式方法介紹
  • JQuery動態給table添加、刪除行 改進版

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.