Issues trying to get an element by id

I didn’t get main part of your question. Still let me try:

document.getElementById('InOrCm').value = "in";

That mean you are adding value to the input with id “InOrCm”. If I am getting you then your syntax is right. Double check your ‘id’ name. check with console output.

document.getElementById('InOrCm').value = "in";
console.log(document.getElementById('InOrCm').value);

Here is second part:

function wpb_adding_scripts() { 
       wp_register_script('HeightComparisonTool', get_template_directory_uri() . '/js/HeightComparisonTool.js','','1.1', true);
       if(is_page( 'javascript-testing-2-2' )) {
          wp_enqueue_script('HeightComparisonTool'); 
       } 
}
add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );