Loop through DIV storing REST Values

Loop through DIV storing REST Values

Hi all,

I have created a div to store values from a REST call as follows:

  1.  $("#projectSiteVariables").data({
  2.                     "projectTitle": value.Title,
  3.                     "projectTitleID": value.SiteTitleID,
  4.                     "projectActiveTitleID": value.ActiveSiteTitleID,
  5.                     "projectArchivedTitleID": value.ArchivedSiteTitleID,
  6.                     "projectTypeID": value.ProjectTypeID,
  7.                     "projectYear": value.Year,
  8.                     "projectSCURL": value.SiteCollectionURL
  9.                 });

How do I loop through this as I need to check if the values in this equal something. Can I reference the div like I would an array?

Example.  

  1. $.each(projectSiteVariables, function (index, item) {
  2. if (($("#projectSiteVariables").data("projectActiveTitleID") == 5) {
  3. alert("hooray");
  4. }