Adding onclick on weather app
How can i add a button with onclick() function in it to show temperature?

1 Like

something like…

<button class= "btn" id= "temp" onclick= "myFunc(">

then put the myFunc() in your JS ?

This aint working my friend.

frikkin codepen or my comp is borked… i can’t check the code… but … is not valid? … should be… getTemp(
and you need a new function to handle the clicks?

function getTemp(clicked_id)
{ // set your return stuff here ?

remember any variables used in multiple functions should be global

p.s. you don’t really need the id stuff… i just use that to keep track of clicks

Can you please edit the code and paste it here? I dont get what you are saying.

check this mebbe?

Thankyou very much friend.:slightly_smiling_face::slightly_smiling_face: