开始:
点击按钮,文本框出现,再次点击,文本框隐藏。
HTML:
<input type="button" class="reply" value="try">
<div class="second">
<input type="text">
</div>
CSS:
<style>
.second{
display: none;
}
</style>
JS:
<script src="public/static/js/jquery-1.11.0.min.js"></script>
<script>
$(function(){
$("input[type=button").click(function(){
if($(this).next().is(":hidden")){
$(this).next().show();
}else{
$(this).next().hide();
}
})
})
</script>