JSFiddle - React, Tailwind, and code Playground

by hopest

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.13/angular.js"></script>
<div id="foo" ng-app ng-controller="Dashboard">
    
    <h1>Root</h1>
    <h1>sample 2</h1>
    <h1 ev-click>sample 3</h1>
    <h1 ev-click> sample 4</h1>
    <h2 ev-click>sample 1</h2>
    <h2 ev-click>sample 2</h2>
    <h2>sample 3</h2>

</div>

CSS

[ev-click]{
        background: #31F7E5;
    }

JavaScript

function Dashboard($scope) {
    'use strict';
    var vm = this;
    var map = {};
    angular.element(document.getElementById('foo')).append("<h2 ev-click>hello 8888888</h2>");
 
}

function evClick() {
    return {
        restrict: "AE",
        link: function (scope, element) {
            element.bind('mousedown', function (event) {
                console.log("mousedown");
            });
           
        }

    };
}