การประยุกต์ใช้ฟังก์ขัน after() กับ text input
เขียนเมื่อ 14 ปีก่อน โดย Ninenik Narkdeeafter text input jquery
คำสั่ง การ กำหนด รูปแบบ ตัวอย่าง เทคนิค ลูกเล่น การประยุกต์ การใช้งาน เกี่ยวกับ after text input jquery
ไปที่
Copy
ตัวอย่างโค้ด
<style type="text/css"> .inp_email{ clear:both;float:left; } </style> <form id="form1" name="form1" method="post" action=""> <div id="mailfriend">Your friend email:</div> <input name="email[]" class="inp_email" type="text" id="email[]" size="35" /> <br style="clear:both;float:left;" /> <input type="submit" name="Submit5" value="บันทัก" /> <input type="button" id="addmail" name="Button2" value="เพิ่มอีเมลล์" /> </form> <script type="text/javascript" src="http://www.ninenik.com/js/jquery-1.7.1.min.js"></script> <script language="javascript"> $(function(){ $("#addmail").click(function(){ // เงื่อนไขการคลิกสำหรับทดสอบ $("#mailfriend").after("<input name=email[] class=inp_email type=text size=35 /><input class=bt_remove type=button value=ลบ />"); }); $(document.body).on("click",".bt_remove",function(){ $(this).prev("input").remove(); this.remove(); }); }); </script>
ตัวอยย่างผลลัพธิ์
กด Like หรือ Share เป็นกำลังใจ ให้มีบทความใหม่ๆ เรื่อยๆ น่ะครับ

URL สำหรับอ้างอิง
Top
Copy
ขอบคุณทุกการสนับสนุน
![]()