I'm basically in the process of creating a Web App for my university course. The main idea being that when a "mood" image is clicked it will search youtube for videos using whatever mood clicked as the search term. For example I'm currently trying to code it so when "Happy" is clicked it will search youtube with the search term being "Happy" then it will return the search results as JSON data.
I have tried putting in "onClick" commands for the "Happy" image but it will need to call a function and so far I can't figure out if there is a way to do this within a function so it can be called.

I've tried to explain this the best I can but I don't know too much about JSON/Javascript so any help would be appreciated! Thanks in advance.