Local weather map

here is my basic code for local weather map.
i’m having trouble changing F to C and vice versa .please help me how can i use Temp function to do so.

Thank you for your response.
i know what you’re saying as a matter of fact i did add a button in the code just before T and called the function using onclick but it wasn’t working ,and since the function returs a value how can i update my T?

i have made few changes but it’s not working.