I found an answer.
MRNbarcodeText.dispatchEvent(new Event('change'));
I didn't know I had to let my razor page know that information had changed on the page. This isn't the case in MVC.