复制代码 代码如下: <input type="button" value="1"/> <input type="button" value="2"/> <input type="button" value="3"/><br> <input type="button" value="4"/> <input type="button" value="5"/> <input type="button" value="6"/><br> <input type="button" value="7"/> <input type="button" value="8"/> <input type="button" value="9"/><br> <input type="text" value=""/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> var items=""; jQuery(function(){ $("input:button").each(function(index){ $(this).mouseover(function(){ if(items.indexOf($('input').eq(index).val())==-1){ items+=$('input').eq(index).val(); $('input:text').val(items) } }) }) }) </script>
推荐阅读
JavaScript高级程序设计阅读笔记(十六) javascript检测浏览器和操作系统-detect.js
检测浏览器的方式 1、对象特征检测法:判断浏览器能力的通用方法。如果更关注浏览器的能力而不在乎它的实际身份,就可以使用这种检测方法。常见的原生Ajax写法中就用这种方法来创建XMLHttpRequest: 复制代码 >>>详细阅读
本文标题:基于jQuery的简单九宫格实现代码
地址:http://www.17bianji.com/kaifa2/JS/23197.html
1/2 1