Skip to content

About

The Arguably Cleaner Way to Select

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery.hook

The Arguably Cleaner Way to Select

jQuery Hook allows you to separate interaction from presentation. By using HTML's data attribute you no long have to depend on CSS classes.

Based on Will Boyd's Sitepoint article

Repurposed with permission by Duncan Heal

Usage

Simply link to jQuery and jQuery.hook, add a data-hook attribute to your element and select away:

HTML:

<button data-hook="nav-menu-toggle">Toggle Nav Menu</button>

jQuery:

$.hook('nav-menu-toggle').on('click', function() {
    $.hook('nav-menu').toggle();
});

License

[MIT License]: http://mit-license.org/

About

The Arguably Cleaner Way to Select

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages