Feedback on my Weather App - work in progress

Hey everyone, I’m still working on this, but this is more of a general feedback question than an immediate help question. I have the site functioning pretty much how I want it at this point, but I’m wondering how I can utilize functions to write cleaner, less redundant code. I have messed around with separating some of the code into functions but then it doesn’t seem to work together for me. It was suggested to me in a chat that I should try and separate UI code from data code. I understand what those are, but not how to actually accomplish this. Here’s a link to my pen and any feedback would be greatly appreciated! Thanks
-Derek

http://codepen.io/derekbmcintire/pen/dvzQgR

Hi @derekbmcintire,

First:
although your html code looks a bit dirty and is very hard to read, it looks like you are a kind of professional already.
I want you to enable your pedantic mode and clean up your code, so it is more easy for others to read.

Second:

You might wanna have a look on reactjs. If you are not familar with it, the good news is that it is pretty easy, but you have to invest time to learn it for a few days. You will learn it for your future, it is not a waste of time. I am sure in one or two weeks you will love the component based approach of reactjs

Feel free to have a look on my weatherapp with reactjs:

Pay deatiled attention to clean code!

Kind regards
@daveyx

P.S.

  • If you like any of my answers feel free to like it by clicking the heart-button
  • If you feel like your topic is solved, you may want to mark your topic as solved

Thanks @daveyx for the feedback and suggestions. I have heard about React, but haven’t gotten around to learning it yet.

Could anyone specifically help me with minimizing the code used for changing the icon? I have tried creating a function so that I can just use it twice, but have been unsuccessful.