http://topic.csdn.net/u/20090812/09/a563f26d-c85f-40fa-870c-1115ae13e6b3.html
和以上的这个链接里边相似的效果,不过要使用jQuery完成效果。请大家帮帮忙~~感恩~~~
和以上的这个链接里边相似的效果,不过要使用jQuery完成效果。请大家帮帮忙~~感恩~~~
解决方案 »
- javaScript中数组元素如何从资料库中读取,用jquery+ajax实现
- easyUI insertRow问题
- 还是定位select选项的问题
- 使用Extjs做头行形式的界面时遇到个很棘手的问题
- ********************************************谁能看到Object.prototype里面的东西吗???
- vml图形导出问题
- 子页面的背景颜色等于父页面的背景颜色什么代码?
- 关于双激滚屏 的代码??速度我怎么控制呢????
- 高手请进!!!请问如何动态移动layer层??
- 请教:颜色的问题
- 帮我看一恶心问题
- google浏览器 怎么取fileupload路径
<input id = "test" type="text" />
<div id = "testlink">
<a href="javascript:;">link1</a>
<a href="javascript:;">link2</a>
<a href="javascript:;">link3</a>
</div>function addstr(){
var $text = $("#test").val() + " " + $(this).text()
$("#test").val($.trim($text));
}
function removestr(){
var $text = $(this).text();
var retext = new RegExp($text+" ?" , "g");
$text = $("#test").val().replace(retext,"");
$text = $.trim($text);
$("#test").val($text);
}
$(function (){
$("#testlink a").click(toggle(addstr,removestr));
});
$("#testlink a").click(toggle(addstr,removestr));
});错了,改成$(function (){
$("#testlink a").toggle(addstr,removestr);
});
<head>
<title>test</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
<!--
function addstr(){
var $text = $("#test").val() + " " + $(this).text()
$("#test").val($.trim($text));
$(this).attr("style","background-color:#ccc;");
}
function removestr(){
var $text = $(this).text();
var retext = new RegExp($text+" ?" , "g");
$text = $("#test").val().replace(retext,"");
$text = $.trim($text);
$("#test").val($text);
$(this).attr("style","");
}
$(function (){
$("#testlink a").toggle(addstr,removestr);
});
//-->
</script>
</head>
<body>
<input id = "test" type="text" />
<div id = "testlink">
<a href="javascript:;">link1</a>
<a href="javascript:;">link2</a>
<a href="javascript:;">link3</a>
</div>
</body>
</html>