3

I have input elements with a custom attribute call field.

<input type="text" (change)="recordChange(currentField,row)" #currentField field="caution">

On the change event, the currentField came back like this one the console.

 <input type="hidden" field="caution" value="plus icon red"> 

I was able to do currentField.value to obtain the value, but I can't seems to figure out how to get the field value. What am I missing?

thanks for your time.

CozyAzure
  • 8,280
  • 7
  • 34
  • 52
chungtinhlakho
  • 870
  • 10
  • 21

1 Answers1

3

There is the getAttribute(...) method for that on elements:

currentField.getAttribute('field')

See also getAttribute() versus Element object properties?

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567