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
  • 7,830
  • 6
  • 31
  • 49
chungtinhlakho
  • 860
  • 9
  • 20

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
  • 558,509
  • 191
  • 1,911
  • 1,506