Jinntakk show local weather (would love some help with extras)

I finished my ‘show local weather’ project, but as you can see from my codepen I’m working on putting in a user input in there and I’d like some help with that if possible.

For now, my code looks like this:

$("#submit").on(“click”, function() {
latitude = select("#latitude");
longitude = select("#longitude");
$("#text-here").html(api + latitude.value() + ‘&lon=’ + longitude.value());

And clearly it’s not working, so if anyone can help me with that I’d really appreciate it! Thank you!

Hi jinntakk.

You’ve assigned variables latitude and longitude. But you do nothing with it.
Look how you could take the input value

latitude = $("#latitude").val();

then use the variables that you have earned with so much trouble.

$("#text-here").html(api + latitude+ longitude)// that doesnt submit the new coordinate but will only appear as an html

myFunction(longitude, latitude) // that has more chance to parse the coordinates

function myFunction(longitude, latitude) {
 // do stuff
}

If you don’t understand. Don’t worry, I would suggest continuing the other challenges thus you will gain more skills and be able to do that later

Okay, I’ll move onto other challenges. Hopefully I can come back to it later!

1 Like