无法访问Mutation Record值

时间:2017-05-30 17:21:01

标签: javascript mutation-observers

MutationObserver(function(mutations){...

我用这行打印过:

console.log('0=', mutations[0]);

如何访问此值:

id:"lbltime"

使用mutations[0].id

时无效
mutations[0].target.id

以下是相关代码的片段:

 gg_observer = new MutationObserver(function (mutations)
                {

                    if (mutations.length == 1)
                        {
                            console.log('mmm=', mutations[0].target);
                            console.log('id=', mutations[0].id);
                            console.log('0=', mutations[0]);
                        }
                    console.log("mutations =", mutations);
                    mutations.forEach(function (mutation)
                        {
                            console.log("mutation=", mutation);
                        });
//function continues below which I've removed

enter image description here

0 个答案:

没有答案