I updated the js function to read the inner HTML instead of the variable