游戏网站投赌注,点击选择数字显示在文本框,如何实现的,首先想到的很可能就是给button绑定事件,如下:
<style type="text/css">button{display: block;width: 40px;height: 30px;margin-bottom: 10PX;text-align: center;background-color: #000;color: #fff;border: 0;line-height: 30px;}
</style>
</head>
<body><button onclick="chips(1000)">1k</button><button onclick="chips(2000)">2k</button><div><input type="text" name="getdaolors" id="betsLeft"></div><script type="text/javascript">function chips (value) {var betsLeft=document.getElementById("betsLeft");betsLeft.value=value;}</script>
</body>
实践了一下是可以实现的,游戏网站采用的是a标签。第一,a标签样式更好调整设计,自身带有的样式少。如下(js纯自己“编造”哈)
<head>
<style type="text/css">a{display: block;width: 40px;height: 30px;margin-bottom: 10PX;text-align: center;background-color: #000;color: #fff;text-decoration: none;line-height: 30px;}
</style>
</head>
<body><a href="javascript:chips(1000)">1K</a><a href="javascript:chips(2000)">2K</a><div><input type="text" name="getdaolors" id="betsLeft"></div><script type="text/javascript">function chips (value) {var betsLeft=document.getElementById("betsLeft");betsLeft.value=value;}</script>
</body>
以上!
目前只想到这两种实现了,欢迎补充!