0

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 {
  }

}
R. Richards
  • 24,603
  • 10
  • 64
  • 64
  • are you looking for some like this [SO](https://stackoverflow.com/questions/66899473/highlight-specific-words-in-textarea-angular-8)? – Eliseo Apr 21 '22 at 21:24
  • Actually I am looking for a way that highlights the entire text in the input field when I press tab key . – Rudrashish Palav Apr 23 '22 at 07:18
  • some like :``? – Eliseo Apr 23 '22 at 10:02
  • I'll try this out , I just now tried it in javascript and it worked for "Enter" key but I want it to work when I press 'Tab'. I'll post another question maybe that helps me clear up my concept. Also thank you for the help :D. – Rudrashish Palav Apr 23 '22 at 16:56

0 Answers0