基于jQuery的简单九宫格实现代码

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

基于jQuery的简单九宫格实现代码

  2020-05-13 我要评论
复制代码 代码如下:

<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>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们