<style>
*:focus {
outline: 2px dashed red;
}
div {
border: 1px solid grey;
border-radius: 5px;
margin: 5px;
padding: 5px;
}
</style>
<div>D1: <input tabindex="1"></div>
<div id="host1" tabindex="5">
<div slot="A">R1A2: <input tabindex="2"></div>
<div slot="B">R1B2: <input tabindex="2"></div>
<div slot="A">R1A1: <input tabindex="1"></div>
<div slot="B">R1B1: <input tabindex="1"></div>
<div>Rx (not assigned): <input tabindex="1"></div>
</div>
<div>D2: <input tabindex="2"></div>
<div id="host2" tabindex="-1">
<div slot="A">R2A: <input tabindex="1"></div>
<div slot="B">R2B: <input tabindex="1"></div>
</div>
<div>D3: <input tabindex="3"></div>
<div id="host3" tabindex="6">
<div slot="A">R3A1: <input tabindex="1"></div>
<div slot="A">R3A-1: <input tabindex="-1"></div>
<div slot="A">R3A2: <input tabindex="2"></div>
<div>Rx (not assigned): <input></div>
</div>
<div>D4: <input tabindex="4"></div>
<template id="t">
<style>
*:focus {
outline: 2px dashed green;
}
div {
border: 1px solid grey;
border-radius: 5px;
margin: 5px;
padding: 5px;
}
</style>
<div>R1: <input tabindex="1"></div>
<div>R4: <slot name="A" tabindex="4"></slot></div>
<div>R2: <input tabindex="2"></div>
<div>R5: <slot name="B" tabindex="5"></slot></div>
<div>R3: <input tabindex="3"></div>
</template>
<script>
function stamp(host_sel, template_sel) {
var host = document.querySelector(host_sel);
var tmpl = document.querySelector(template_sel);
var root = host.attachShadow({mode: 'open'});
root.appendChild(document.importNode(tmpl.content, true));
}
stamp('#host1', '#t');
stamp('#host2', '#t');
stamp('#host3', '#t');
</script>
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. |