Backbone.js-在devTools中获取要打印的childElementCount值
我试图在chrome开发工具中记录Backbone.js-在devTools中获取要打印的childElementCount值,backbone.js,marionette,children,document-body,Backbone.js,Marionette,Children,Document Body,我试图在chrome开发工具中记录childElementCount属性,但未定义 这是我的代码: console.log('childElementCount---', this.ui.tbody.get('childElementCount') 返回未定义的子元素计数 为什么它没有定义 jQuery用于从jQuery对象检索底层DOM元素。它接受整数索引而不是字符串。 尝试this.ui.tbody.get(0).childElementCount或this.ui.tbody.get(0)
childElementCount
属性,但未定义
这是我的代码:
console.log('childElementCount---', this.ui.tbody.get('childElementCount')
返回未定义的子元素计数
为什么它没有定义
jQuery用于从jQuery对象检索底层DOM元素。它接受整数索引而不是字符串。
尝试this.ui.tbody.get(0).childElementCount
或this.ui.tbody.get(0).getAttribute('childElementCount')
或者使用jQuery:
this.ui.tbody.prop('childElementCount')
或this.ui.tbody.children().length