$(function(){ //Fetch Questions From JSON File "questions.js" let fetchQuestions = () = { $.getJSON("json/questions.json", function(obj){ $.each(obj, function(key, value) { $(".js-questions").append(` <li class="questions__question" <div <span${value.count}</span ${value.question} <input type="text" class="questions__answer js-answer" answer="${value.answer}" onfocus="focusField(this)"/ </div </li `); }); }); } fetchQuestions(); let focusField = (element) = { $(element).css("background-color", "yellow"); } })
2.1m questions
2.1m answers
60 comments
56.8k users