当我执行下面的代码,它的行为像我期望(记录了DIV
元素的内容):表格选择不工作动态标记工作
var html = '<form action="/" method="get" name="myform"><div>123</div></form>';
console.log($('div', html));
什么我不明白是为什么以下代码不起作用:
var html = '<form action="/" method="get" name="myform"><div>123</div></form>';
console.log($('form', html));
他们似乎是相同的,所以为什么当FORM
选择不将DIV
选择工作?
你知道'$('div',html)'语法是如何工作的吗? – j08691 2014-09-10 19:44:54