Akhilesh Pandit

Akhilesh Pandit

  • NA
  • 772
  • 453.6k

How To add append Div to textbox using angularjs

Oct 15 2016 8:34 AM
I want to make a tooltip on textbox,For this i make angularjs attribute directive but my div is not showing.
 
HTML code:-
address1<input type="text" ng-model="data2" tooltip5 style="width:50px" />
 
angularjs code:-
 
app.directive('tooltip5', function ($compile) {
return function (scope, elm, attrs) {
elm.bind("mouseover", function () {
var el = angular.element('<span/>');
el.append('<div style="display:inherit;background-color:red">hjjjjjjjjjjjjj</div>');
$compile(el)(scope);
elm.append(el);
});
}
});
 
 
when i see Inspect div is added into TextBox but it will not display.
 
Please some one help me 

Answers (3)