调试DOM对象或我如何看到对象 [英] Debug DOM objects OR how I can see object
本文介绍了调试DOM对象或我如何看到对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在浏览器控制台中看到对象,在C#中是正确的方法toString()但在javascript中它不起作用:
console .log(' DEBUG:' + $( this )。nearest(' #comments')。toString());
结果如下:
DEBUG:[object Object]
解决方案
( this )。nearest(' #comments')。toString());
结果如下:
DEBUG:[object Object]
(本).parent()。父()。父()。CSS( '背景色', '#000');
How can I see object in browser console, erly in C# was method toString() but in javascript it's don't work:
console.log('DEBUG: ' + $(this).closest('#comments').toString());
the result look like:
DEBUG: [object Object]解决方案(this).closest('#comments').toString());
the result look like:
DEBUG: [object Object]
(this).parent().parent().parent().css('background-color', '#000');
这篇关于调试DOM对象或我如何看到对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文