<html>
<head>
<meta charset="utf-8">
<title>注册</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="format-detection" content="telephone=no"/>
</head>
<body>
<div class="container">
<form class="registform">
<div class="formgroup g1">
<input type="tel" placeholder="手机验证码" />
<button id="getCode">获取验证码</button>
</div>
</form>
</div>
</body>
</html>
button, input, select, textarea {
padding: 0;
margin: 0;
border: 0;
outline: none;
appearance: none;
}
.container{
width: 400px;
margin:0 auto;
padding: 30px 0;
}
.container h3{
height: 40px;
line-height: 40px;
font-size: 18px;
color: #333333;
text-indent: 5px;
}
.registform input{
width: 100%;
height: 50px;
font-size: 18px;
padding-left: 15px;
border: 1px solid #aaaaaa;
box-sizing:border-box;
box-sizing:border-box;
}
.formgroup{
position: relative;
margin-top: 20px;
}
.g1{padding-right: 100px;}
.registform .g1 input{border-right: 0;}
.g2{padding-right: 50px;border: 1px solid #aaaaaa; }
.registform .g2 input{border: 0;}
#getCode{
position: absolute;
top: 0;
right: 0;
width: 100px;
height: 50px;
font-size: 18px;
background-color: #e35437;
color: #fff;
}
#getCode[disabled]{
background-color: #B6B6B6;
}
var getCode = document.getElementById('getCode');
var wait = 60;
function time(btn){
if (wait===0) {
btn.removeAttribute("disabled");
btn.innerHTML = "获取验证码";
wait = 60;
}else{
btn.setAttribute("disabled",true);
btn.innerHTML = wait + "秒后重试";
wait--;
setTimeout(function(){
time(btn);
},1000);
}
}
getCode.onclick = function(){
time(this);
};
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |