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

网络编程 发布日期:2024/10/11 浏览次数:1

正在浏览:基于jQuery的简单九宫格实现代码
复制代码 代码如下:
<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="/UploadFiles/2021-04-02/jquery.min.js"><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>