JSFiddle - React, Tailwind, and code Playground
by Michel Penke
HTML
<input id="company">
<input id="test">
JavaScript
const companyInput = document.getElementById('company');
const targetInput = document.getElementById('test');
// Add an event listener for the 'keydown' event on the companyInput
companyInput.addEventListener('keydown', function(event) {
// Check if the Enter key was pressed
if (event.key === 'Enter') {
// Copy the value from companyInput to targetInput
targetInput.value = companyInput.value;
}
});