如何获取属性js对象。当我使用$('body')
时,它有时会以对象形式返回,其他时间只返回一个属性,所以我该如何在该属性上执行我的任务。如..只从属性获取属性只有一个属性JQuery
$('body').html();
// it will return in object
// [<body></body>]
// or sometime it will return only
// <body></body>
// if it will return in object so i got some error like.
Uncaught TypeError: $(...).html is not a function
我怎样才能使倒流性是否一致?因为我想在某些情况下使用它,所以如果我想每次在对象或只有一个属性中使用它,就不能像这样使用它。
如果在对象返回我想用eq()
但是当它在对象的形式返回,当它返回的唯一属性,然后我如何使用eq()
,因为没有与唯一的财产使用我不知道。
你试过我的答案? –