MC-XOBAHCK,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
мм: <input type="number" name="unit"><br>
см: <input type="number" name="unit"><br>
м: <input type="number" name="unit"><br>
<script>
let unit = document.querySelectorAll('input[name="unit"]');
const rang = [1000, 100, 1];
unit.forEach((el, i)=> (el.value = rang[i], el.addEventListener('input', function () {
let val = el.value / rang[i];
unit.forEach((el, k)=>{
el.value = val * rang[k]
})
})));
</script>
</body>
</html>