0

A couple of months ago, only in Chrome (my version Version 103.0.5060.114 (Official Build) (x86_64) OSX 12.4), onFocus events added using JavaScript do not fire. They fire in iOS Chrome, other browsers and will fire in Chrome OSX when embedded in the HTML.

let lblP = document.createElement('label');

let inpDesc = document.createElement('input');
        inpDesc.type = "text";
        inpDesc.className = "input_Text  marginLeft holdStatus"; 
        inpDesc.size="115";
        inpDesc.id = "holdcremation_description_" + newRow.rowIndex;
        inpDesc.name = "holdcremation_description_" + newRow.rowIndex;
        inpDesc.value = "";
        
        descID = inpDesc.id;
        //will need sync and array update
        inpDesc.onfocusout=function() {
            
            updateArrayOnClick('holdeventsstatus_List', 'holdeventsstatus_List', this.id, 'description', this.value);
            //updateSureMap(this.id, this.value, '');
            };
            
        lblP.appendChild(inpDesc);
Jim Geldermann
  • 183
  • 3
  • 18

1 Answers1

0

To add focusout listener, use

inpDesc.addEventListener('focusout', () => {
   // your code
})
```

or follow this code sample here works too. https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onfocusout

Jecfish
  • 4,026
  • 1
  • 18
  • 16