基于jQuery的简单九宫格实现代码
基于jQuery的简单九宫格实现代码
发布时间:2016-12-30 来源:查字典编辑
摘要:复制代码代码如下:varitems="";jQuery(function(){$("input:button").each(function...

复制代码 代码如下:

<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教程学习
编程开发子分类