【发布时间】:2018-07-13 13:02:06
【问题描述】:
我创建了新的<div> 元素:
jQuery('<div id="es_name" class="form-group row"><label for="inputPassword" class="col-sm-2 col-form-label">Naam</label><div id="firstname" class="col-sm-5 firstname"></div><div class="col-sm-5 lastname"></div></div>').appendTo('.woocommerce-billing-fields__field-wrapper');
现在我想将标准的#billing_first_name_field 移到#es_name div 中,或者如果可能的话,甚至移到#firstname div 中。
以下代码不起作用:
jQuery("p#billing_first_name_field").appendTo("#es_name");
有人可以帮帮我吗?
【问题讨论】:
-
只有名字字段?
-
现在是的。
-
目前当你尝试
jQuery("p#billing_first_name_field").appendTo("#es_name");时会发生什么 -
没有任何变化。如您所见,标记保持不变。
-
只需在浏览器控制台中运行它来检查任何错误
jQuery("p#billing_first_name_field").appendTo("#es_name");
标签: jquery wordpress woocommerce