<style>
#container {
font-family: 'Yu Gothic', 'YuGothic', 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
font-size: 20px;
display: grid;
gap: .5em;
grid-template-columns: 1fr 1fr;
width: 26em;
overflow: hidden;
resize: horizontal;
}
.test {
border: 1px solid blue;
user-modify: read-write;
}
#normal {
text-spacing-trim: normal;
grid-column: 1;
grid-row: 2;
}
#space-all {
text-spacing-trim: space-all;
grid-column: 1;
grid-row: 1;
}
#trim-start {
text-spacing-trim: trim-start;
grid-column: 2;
grid-row: 2;
}
#space-first {
text-spacing-trim: space-first;
}
label {
display: block;
font-size: 80%;
}
</style>
<div id="container">
<div id="normal">
<label>normal (Chrome 123 default)</label>
<div class="test">
(東)、【「(東)」】。<br>
「東」「東」「東」東東東「東」。
</div>
</div>
<div id="space-all">
<label>space-all (Chrome 122)</label>
<div class="test"></div>
</div>
<div id="trim-start">
<label>trim-start</label>
<div class="test"></div>
</div>
<div id="space-first">
<label for="space-first">space-first</label>
<div class="test"></div>
</div>
</div>
<script>
const tests = document.getElementsByClassName('test');
function copy_to_mirrors(source) {
const text = source.textContent;
for (const test of tests) {
if (test == source) { continue; }
test.textContent = '';
for (const child of source.childNodes) {
test.appendChild(child.cloneNode(true));
}
}
}
copy_to_mirrors(tests[0]);
for (const test of tests) {
test.addEventListener('input', (e) => {
copy_to_mirrors(e.target); });
}
</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. |