I am getting stacked with inserting the content returned by an ajax call.
I have a set of divs, each div has a different id example:
<div id ="first_name"> content </div>
<div id ="last_name"> content </div>
<div id ="email"> content </div>
on the other hand I have an object with key => value example:
{"first_name" : "value", "last_name" : "value", "email" : "value"}
the keys of the object match the div’s ids.
how can I on $(document).ready() search for the matching ids and object keysand put their values in jquery?
Original answer:
Edited to address question in comments:
You want this to happen automatically? When you receive new data from an ajax call?