![]() ![]() Raeford, NC (February 17) – Yanmar America is delighted to be a gold medal sponsor of the CCI4*-S division at the 10th Annual Carolina International CCI and Horse Trial, an equestrian competition held at the Carolina Horse Park March 16th to 19th. You can use e.target to see what element was actually clicked on.Īs a convenience you can leave out the selector argument to bind an event directly to the original element Gator(document).Yanmar America will sponsor the CCI4*-S division at the 10th Annual Carolina International CCI and Horse Trial. For example if you click on a span inside of a td it will trigger the event as if you clicked on the td and this in the callback will still reference the td. This example will fire even if you click on an element inside of a td. Gator(table).on('click', 'td', _doStuff) Suppose you wanted to add a click event to every td inside of a table var table = document.getElementsByTagName('table') * Note that when using the legacy plugin you can only use a single class name, id, or tag name for the selector argument. That means in the example above if you reference this in your callback this corresponds to the td element. The callback is invoked in the context of the selector passed in. The callback gets passed a single argument containing the browser Event object. callback A callback function to fire when the event occurs. You can also pass in an array of multiple event types, for example selector A CSS selector for elements to look for within the outer element*. The on method accepts 3 arguments: eventType Any browser event that you would normally pass to addEventListener. ![]() Or use the new keyword new Gator(element) Īttaching events uses the Gator.on method. To instantiate a Gator object call the function directly: Gator(element) The methods that do event delegation are prototype methods on the Gator object. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |