Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//you need this first bit for all jquery code
// Click on an a tag with class="studio"
// Assign variable studioName to the attribute "data-name" in the a tag. Convert it to text
var studioName = $(this).attr('data-name');
// Get the json
if(studioName =={
//Replace each of the divs with text from different parts of the json
$("#logo").attr("src", value.logo);
$("#featuredimg").attr("src", value.image);
//if your code echoes this, the name was not in your data (fail safe)
console.log("sorry, that item wasn't in the list");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.