Angularjs set focus on first textbox

Ajax AngularJS Technology

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!.

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.

    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


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.

Related FAQ

Here are some more FAQ related to this Article:

  1.   Check WordPress Plugin Dependencies
  2.   Laravel 6 Get All query string parameters
  3.   Angular 6 Templating Tutorial with Examples
  4.   Golang Float64s function - Math function
  5.   Sticky Social Media Floating Sidebar html
  6.   Laravel 6 group by month/year using Eloquent
  7.   Angular 9/8 Material Radio Button Examples
  8.   jquery Increment Animating Numbers Counting Up Example
  9.   Laravel 5.7 custom 404 Error Page Using Exception Handlers
  10.   Laravel Left join get last record of right table in MYSQL

Leave a Reply

Your email address will not be published. Required fields are marked *