Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="log" data-bind="text: computedLog"></div>
<!--ko if: step() == 0-->
<p>Имя: <input data-bind="textInput: firstName" /></p>
<!--ko if: step() == 1-->
<p>Фамилия: <input data-bind="textInput: lastName" /></p>
<!--ko if: step() == 2-->
<div>Префикс: <select data-bind="value: prefix, options: ['Мистер', 'Мисс','Миссис','Доктор']"></select></div>
<h2>Привет, <span data-bind="text: fullName"> </span>!</h2>
<p><button type="button" data-bind="click: next">Далее</button></p>


                button {
    position: absolute;
    bottom: 1em;
.log {
    /*float: right;*/
    height: 6em;
    background: white;
    border: 1px solid black;
    width: 50%;
    overflow-y: scroll;


                function AppData() {
    this.firstName = ko.observable('Джон');
    this.lastName = ko.observable('Бёрнс');
    this.prefix = ko.observable('Доктор');
    this.computedLog = ko.observable('Лог: ');
    this.fullName = ko.pureComputed(function () {
        var value = this.prefix() + " " + this.firstName() + " " + this.lastName();
        // Обычно, стоит избегать записи observable-переменных внутри pure computed
        // переменной (предотвращение сторонних эффектов). Но этот пример демонстрирует 
        // её внутреннюю работы, и запись лога в данном случае хорошо подходит.
        this.computedLog(this.computedLog.peek() + value + '; ');
        return value;
    }, this);
    this.step = ko.observable(0); = function () {
        this.step(this.step() === 2 ? 0 : this.step()+1);
ko.applyBindings(new AppData());