Question: I'm getting script.js:2 Uncaught ReferenceError: $ is not defined i;m stuck // Set the date at the top of the page $(#currentDay).currentTime(moment().format(dddd, MMMM Do)); //

I'm getting "script.js:2 Uncaught ReferenceError: $ is not defined" i;m stuck

// Set the date at the top of the page

$("#currentDay").currentTime(moment().format("dddd, MMMM Do"));

// Set the status of each time-block

$(".time-block").each(function() {

var currentTime = moment().hours();

var timeBlock = parseInt($(this).attr("id").split("-")[1]);

if (timeBlock < currentTime) {

$(this).addClass("past");

} else if (timeBlock === currentTime) {

$(this).addClass("present");

} else {

$(this).addClass("future");

}

});

// Load any saved data from localStorage

$(".description").each(function() {

var timeBlock = $(this).parent().attr("id");

var savedData = localStorage.getItem(timeBlock);

if (savedData) {

$(this).val(savedData);

}

});

// Save the data to localStorage on click

$(".saveBtn").on("click", function() {

var timeBlock = $(this).parent().attr("id");

var description = $(this).siblings(".description").val();

localStorage.setItem(timeBlock, description);

});

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!