时间:2021-07-01 10:21:17 帮助过:158人阅读
html中
<style type="text/css">
input[type='text'] {
width: 100px;
height: 30px;
border-radius: 5px;
}
</style>
</head>
<body>
<p>
标题:<input class="InputTitle" value="" type="text" />
</p>
<!-- js响应"内容"输入框变大事件:src="/js/article/change_input.js" -->
<p>
内容:<input class="InputContent" value="" type="text_content" />
</p>js代码中
$(document).ready(function() {
$("input[type='text_content']").focus(function() {
$(this).animate({
"width" : "400px",
"height" : "70px"
})
}).blur(function() {
$(this).animate({
"width" : "100px",
"height" : "30px"
})
});
});相关推荐:
javascript代码实现input输入框模糊提示功能
JS实现点击下拉菜单把选择的内容同步到input输入框内的实例
input输入框中的光标大小显示不一致应该怎么解决
以上就是js实现input输入框点击变大缩小的详细内容,更多请关注Gxl网其它相关文章!