JSFiddle - React, Tailwind, and code Playground

by phoffman

HTML

<div ng-app="Test">
    <div ng-controller="Foo">
        <button id="myId" ng-click="hi($event)">click me</button>    
    </div>
</div>

JavaScript

angular.module('Test',[]).controller('Foo', function ($scope, $element) {
    $scope.hi = function (e) {
       var elem = angular.element(e.srcElement); //e.target works as well
       elem.css('background', 'blue');
       alert(elem.attr('id')); //grab whatever elem attr youwant
    }
    
    
})