Angularjs set focus on first textbox

Angularjs set focus on first textbox

In this Post We Will Explain About is Angularjs set focus on first textbox With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Angular js auto focus for input box Example

In this post we will show you Best way to implement How to set focus on first textbox of the page in angular, hear for Automatically Set Focus on a Textbox (Input Box) in AngularJS with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Also Read This πŸ‘‰   Sudo Unable To Resolve Host Error in Linux - Fix sudo

External Include file

AngularJS is a simple JavaScript framework Include one type of the (library) based on a very user friedly popular software mvc based architecture menas called the MVC.

    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>

    <script src=""></script>


The Angular simple directives and the User’s view HTML DOM in a web-application page form the HTML view. In our example(, the simple HTML view comprises the HTML All the element, and then simple two angular directives Like as a namely angular ng-app as well as agular ng-controller

<h1>Angularjs set focus on first textbox Example</h1>
    <div ng-app="liveApp" ng-controller="liveCtrl">
<!-- Devloped by free download examples -->
            <input type="text" id="date" datepicker ng-model="val_date" 
                placeholder="Select a any date" />
        <p ng-if="val_date" ng-init="simpleSetFocus()">
            <input type="text" placeholder="Please Enter some value" id="t" />


The simple angular controller works as a all the data of the mediator between HTML views and models.

Also Read This πŸ‘‰   Laravel 6 Set Active Navigation Menu Example

    var liveApp = angular.module('liveApp', []);
        function ($scope, $window) {

            $scope.simpleSetFocus = function () {
                var dataparam = $window.document.getElementById('t');
	//simple directive in angular
    liveApp.directive("datepicker", function () {
        function link(scope, element, attrs, controller) {
		//scope datepicker
                onSelect: function (dt) {
				//apply datepicker function
                    scope.$apply(function () {
                dateFormat: "mm/dd/yy"
        return { require: 'ngModel', link: link };

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Also Read This πŸ‘‰   Handle CORS Requests in Laravel 6 Application


I hope you have Got What is Automatically Set Focus on a Textbox (Input Box) in AngularJS And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.