• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    DOM Node removeClass (gallery-dom-node-removeclass) on cdn

    Last Updated: 08/27/10
    + 1 -

    Marcel Duran

    YUI Contributor

    See 1 more by this user.

    Created: 08/26/10
    Last CDN Push: 09/1/10
    Build Tag: gallery-2010.09.01-19-12
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.1.2
    Free for use.

    This module overrides DOM, Node and NodeList .removeClass methods, it allows removing multiple or single classes at once like the popular framework jQuery does.
    It reduces the number of chainning, i.e.: node.removeClass('foo').removeClass('bar') becomes node.removeClass('foo bar') and has some performance improvement (see performance test page and source code).

    • Tags:
    • remove
    • classes
    • multiple
    • dom
    • nodelist
    • class
    • removeclass
    • node
    • marcelduran
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    The code below create a node with multiple classes then remove some classes at once.

    Code Sample

    <script src="http://yui.yahooapis.com/3.1.2/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2010.09.01-19-12'
    }).use('gallery-dom-node-removeclass', function(Y) {
     
        var node = Y.Node.create('<p class="foo bar baz bat abc">sample</p>');
        node.removeClass('bar abc bat');
        Y.log(node.get('className'); // "foo baz"
     
    });

    Forum Posts

    No forum posts for this module.

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info