<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button id="btn-1">/b/ or /v/</button>
<button id="btn-2" >/b/ or /p/</button>
<button id="btn-3" >/I/ or /e/</button>
<button id="btn-4" >/e/ or /a/</button>
<br />
<br />
<br />
<button id="submit">Submit</button>
<div class="output-box">
<p id="output1"></p>
<p id="output2"></p>
<p id="output3"></p>
<p id="output4"></p>
</div>
</body>
</html>
.output-box{
background-color: black;
width:400px;
height:400px;
}
#output1{
color: white;
}
#output2{
color: white;
}
#output3{
color: white;
}
#output4{
color: white;
}
var b_or_v =["bet- vet","bat- vat","reb- rev","bick- vic","ban- van"];
var b_or_p =["back- pack","bet- pet","bit- pit","ban- pan","bin- pin"];
var I_or_e =["bit- bet","pit- pet","sit- set","rib- reb","pick- peck","pin- pen","rip- rep"];
var e_or_a =["bet- bat","set- sat","vet- vat","peck- pack","pet- pat","pen- pan","rep- rap"];
document.getElementById("btn-3").onclick= function(){
document.getElementById("submit").onclick= function(){
document.getElementById("output3").innerHTML = "I_or_e: " + I_or_e;
};
};
document.getElementById("btn-4").onclick= function(){
document.getElementById("submit").onclick= function(){
document.getElementById("output4").innerHTML = "e_or_a: " + e_or_a;
};
};
document.getElementById("btn-2").onclick= function(){
document.getElementById("submit").onclick= function(){
document.getElementById("output2").innerHTML = "b_or_p : " + b_or_p;
};
};
document.getElementById("btn-1").onclick= function(){
document.getElementById("submit").onclick= function(){
document.getElementById("output1").innerHTML = "b_or_v : " + b_or_v;
};
};
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. |