Need some help to convert the type of TEXT to NUMBER

Your code needs to be inside of the register_click() function in order for your code to be able to access the page elements.