jQuery Listarea

Listarea.js is a jQuery plugin that allows you to quickly and easily add a list of items to a textarea or input field.

Demo

Easily collect a structured list of items from your user. List will then get submitted in your form as a comma delimited list or with a delimiter of your choice. (ex. grocery list, list of colors, etc...)

Optional parameters - delimiter, effect, placeholder

Setup

<link rel="stylesheet" type="text/css" href="stylesheets\listarea.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="javascripts\jquery.listarea.js"></script>

Sample Html

<form id="demoForm">
	<label for="listarea">List Area:</label>
	<textarea id="listarea" name="listarea"></textarea>
	<input type="submit" value="See List" />
</form>

Javascript

$('#listarea').listarea({
	effect: 'slow'
});
下载代码说明
X关闭

实用的jquery输入框增加列表代码

效果:在输入框中输入文字,点击“添加”后,将输入框中的内容动态添加到顶部,效果很不错 使用方法: 1、在网页head中增加css样式 2、将html复制到你需要的地方 3、在网页底部调用本案例五个js代码即可搞定