先給大家展示效果圖,如果大家覺得還不錯,請繼續參考實現代碼。
廢話不多說了,直接給大家貼代碼了。
代碼如下:
<!DOCTYPE html><html><head><title>jquery刪除添加輸入文本框</title><base target="_blank" /><meta charset="utf-8"><link rel="stylesheet" type="text/css" /><style>.hovertreeinfo{clear:both;text-align:center;}.hovertreeinfo a{color:blue}.hovertreebd{display:inline-block;width:336px;height:280px;}</style></head><body><div class="site"><div class="title">標簽:</div><div class="tip"><div class="tip-container"><span class="jia"></span>添加標簽</div></div></div><div class="hovertreeinfo"><input type="button" value="獲取全部值" id="hovertreeall" /><br /><span id="hovertreeresult"></span><br /><a >原文</a> <a >首頁</a> <a >特效</a></div><script type="text/javascript" src="http://down.hovertree.com/jquery/jquery-1.12.3.min.js"></script><script type="text/javascript" src="http://hovertree.com/texiao/jquery/67/js/tip.js"></script><script>$("#hovertreeall").on("click", function () {$("#hovertreeresult").html("<br />");$(":input.house-tip").each(function () {// alert($(this).val());$("#hovertreeresult").append($(this).val()+"<br />");})})</script></body></html>
以上所述是小編給大家介紹的jQuery添加和刪除輸入文本框標簽代碼的相關知識,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網網站的支持!
新聞熱點
疑難解答