How To Access Element That Triggered Event In AngularJS 1.x

Posted by Weston Ganger

If your using angular and you want to access the DOM element that triggered the event but do not want to query the DOM to do so, then you can access it from your method like so.

<button type="button" ng-click="doWork($event)">Click This</button>

.controller("MyCtrl", function($scope){
  $scope.doWork = function($event){
    var element = angular.element($;

Related External Links:

Article Topic:Software Development - Angular

Date:November 15, 2016

Recommended Posts



Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected