js realizes the input box to be enlarged and reduced when clicked
Mar 07, 2018 pm 05:07 PMThis article mainly shares with you the js example code that realizes the input box to be enlarged and reduced by clicking on it. I hope it can help everyone.
1. Click the input input box to enlarge and shrink the js code
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 code
$(document).ready(function() { $("input[type='text_content']").focus(function() { $(this).animate({ "width" : "400px", "height" : "70px" }) }).blur(function() { $(this).animate({ "width" : "100px", "height" : "30px" }) }); });
Related recommendations:
Javascript code implements the fuzzy prompt function of the input input box
How to solve the problem of inconsistent cursor size display in the input input box
The above is the detailed content of js realizes the input box to be enlarged and reduced when clicked. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

How to implement an online reservation system using WebSocket and JavaScript

How to use JavaScript and WebSocket to implement a real-time online ordering system

JavaScript and WebSocket: Building an efficient real-time weather forecasting system

Simple JavaScript Tutorial: How to Get HTTP Status Code

How to get HTTP status code in JavaScript the easy way

How to use insertBefore in javascript
