手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery实现鼠标单击网页文字后在文本框显示的方法
jQuery实现鼠标单击网页文字后在文本框显示的方法
摘要:本文实例讲述了jQuery实现鼠标单击网页文字后在文本框显示的方法。分享给大家供大家参考。具体实现方法如下:无标题文档张三李四王五赵六选择姓...

本文实例讲述了jQuery实现鼠标单击网页文字后在文本框显示的方法。分享给大家供大家参考。具体实现方法如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script src="js/jquery.min.js" type="text/javascript"></script> </head> <body> <ul> <li>张三</li> <li>李四</li> <li>王五</li> <li>赵六</li> </ul> <table width="200" border="1" cellspacing="0" cellpadding="0"> <tr> <td>选择</td> <td>姓名</td> </tr> <tr> <td><input type="checkbox" name="checkbox" value="1" /></td> <td><input type="text" name="username" value="" /></td> </tr> <tr> <td><input type="checkbox" name="checkbox" value="1" /></td> <td><input type="text" name="username" value="" /></td> </tr> <tr> <td><input type="checkbox" name="checkbox" value="1" /></td> <td><input type="text" name="username" value="" /></td> </tr> </table> <script> $("ul li").click(function(){ var text = $(this).text(); $("input").val(""); $("input:checked").parents("td").siblings("td").children("input").val(text); }) </script> </body> </html>

希望本文所述对大家的jQuery程序设计有所帮助。

【jQuery实现鼠标单击网页文字后在文本框显示的方法】相关文章:

js实现鼠标划过给div加透明度的方法

JQuery实现动态添加删除评论的方法

jQuery实现延迟跳转的方法

jQuery实现文本展开收缩特效

javascript实现点击后变换按钮显示文字的方法

javascript实现动态改变层大小的方法

js实现字符串转日期格式的方法

jQuery插件jRumble实现网页元素抖动

JavaScript实现鼠标拖动效果的方法

javascript实现行拖动的方法

精品推荐
分类导航