Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div id="article">
  <h1>新店市好吃的餐廳</h1>
  <ul class="restaurant">
    <li>可愛村便當:台北縣新店市大豐街8號</li>
    <li>阿輝現炒黃牛肉:台北縣新店市中興路三段225號</li>
    <li>黑人牛肉麵:台北縣新店市中興路三段176號</li>
    <li>蘇杭:台北縣新店市民權路25號2F</li>
    <li>王家包子:台北縣新店市國校路25號之1</li>
    <li>辣。四川成都小炒:台北縣新店市吉安路2-1號</li>
    <li>山東餃子館:台北縣新店市中央路133巷19號1樓</li>
    <li>樂陶然健康小火鍋:台北縣新店市中央五街2號</li>
    <li>六六火鍋:台北縣新店市中央路89號</li>
    <li>龍門客棧:台北縣新店市中央路98號之1</li>
    <li>麵對麵:台北縣新店市中央路33號</li>
  </ul>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                YUI().use('node',"event", function (Y) {
        var module = Y.one("#article");

        Y.one("body").on("click", function (){
            alert("hi");
            });
       /*
         use delegate to prevent to much event add to li item, when items are a lot
        */
        module.delegate("click",function(e){
            
            //e.halt(); // this is used as the two following codes
            e.preventDefault();
            e.stopPropagation();
            var node = e.target;
            node.setContent(node.getContent()+"is clicked");
            node.addClass("highlighted");
            },"li");
    });
              
            
!
999px

Console