'Highlight text/number/data inside input field using keydown in Angular

I have an input field in which I write some text/numbers/etc . I get the data in this input field after I press Tab key. I want to add a button next to the input field which gets clicked after I press Tab key. Also I wish the data/text/etc inside the input field gets highlighted(blue selection) when I press Tab key.

Here's the code so far.

HTML file

<input (keydown.Tab)="ABC($event)">

TS file

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-tab',
  templateUrl: './tab.component.html',
  styleUrls: ['./tab.component.css']
})
export class TabComponent implements OnInit {

  constructor() { }

  ABC(event:any){
    console.log(event.target.value);
  }

  ngOnInit(): void {
  }

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source