Friday, March 23, 2018

Dynamic javascript Object/Json creation





function createJSON() {
    jsonObj = [];
   
        var id = $(this).attr("title");
        var email = $(this).val();
        item = {}
        item ["title"] = id;
        item ["email"] = email;

        jsonObj.push(item);
 

    console.log(jsonObj);
}

No comments:

Post a Comment

javascript Filter/index off

 var family = [{"name":"Jack",  "age": 26},               {"name":"Jill",  "age"...