<!DOCTYPE html><html><head> <title></title> <script type="text/javascript" src="jquery-1.8.2.min.js"></script></head><style type="text/css"> .box{width: 600px;height: 300px;border: 1px solid #ccc;margin: 0 auto} .func span{margin-right: 10px;cursor: pointer;}</style><body> <div class="box"> <input type="text" name="" value=""> </div> <div class="func"> <span>補(bǔ)水,</span><span>保濕,</span><span>去皺,</span><span>美白,</span> </div></body><script type="text/javascript"> $(".func span").click(function(){ h=$(this).html(); $(".box input").attr("value").append(h); });</script></html>我這里寫(xiě)的是錯(cuò)的 我是想實(shí)現(xiàn) 點(diǎn)一下span 然后往input value里添加一個(gè)值
jquery 如何向input value里追加值
慕桂英3389331
2018-11-24 19:15:35