Focus Event of Textbox

Data will be copied and displayed when the textbox is focused. Change the input text, focus can be taken out and entered again to reflect the changes in data display .
Your Name
Welcome : {{t1}}
<div ng-app="my_app" ng-controller="my_ctrl">
Your Name <input type=text ng-model="t1" class=form-control ng-focus="my_focus_Method()"> 

<b>Welcome</b> : {{t1}}
</div>
<div class='alert alert-primary' role='alert' id=d1>
With  the focus method, Textbox data will appear here
</div>
<script>
var app = angular.module('my_app', []);
app.controller('my_ctrl', function($scope) {
   $scope.t1= "Robort";
   $scope.my_focus_Method = function(){
	  document.getElementById('d1').innerHTML=$scope.t1; 
   }
});
</script>
Textbox

Angular Home

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer