Skip to content

Commit 2ecbf58

Browse files
committed
Basic Plugin Creation: remove confusing sentence
1 parent a22a743 commit 2ecbf58

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

page/plugins/basic-plugin-creation.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ $( "a" ).css( "color", "red" );
1717

1818
This is some pretty basic jQuery code, but do you know what's happening behind the scenes? Whenever you use the `$` function to select elements, it returns a jQuery object. This object contains all of the methods you've been using (`.css()`, `.click()`, etc.) and all of the elements that fit your selector. The jQuery object gets these methods from the `$.fn` object. This object contains all of the jQuery object methods, and if we want to write our own methods, it will need to contain those as well.
1919

20-
Additionally the jQuery utility method `$.trim()` is used above to remove any leading or trailing empty space characters from the user input. Utility methods are functions that reside directly in the `$` function itself. You may occasionally want to write a utility method plugin when your extension to the jQuery API does not have to do something to a set of DOM elements you've retrieved.
21-
2220
## Basic Plugin Authoring
2321

2422
Let's say we want to create a plugin that makes text within a set of retrieved elements green. All we have to do is add a function called `greenify` to `$.fn` and it will be available just like any other jQuery object method.

0 commit comments

Comments
 (0)