<!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>补水,</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>
我这里写的是错的 我是想实现 点一下span 然后往input value里添加一个值
绝地无双
相关分类