[英]How to add child nodes to parent nodes without having view jump to where element is being loaded?
[英]How to add a property/ styles to child nodes inside a parent element in angular
我有一张桌子
<table>
<thead>
<tr> </tr>
</thead>
<tbody>
<tr> </tr>
</tboday>
</table>
我想在<tbody>
中的<tr>
中添加一个属性,而不是<thead>
添加此行后(<HTMLElement>document.querySelector('tr')).setAttribute("draggable", "true");
桌子看起来像
<table>
<thead>
<tr draggable=true> </tr>
</thead>
<tbody>
<tr> </tr> // note here there is no above mentioned property. I need to put here
</tboday>
</table>
如何在<tobdy>
中将draggable=true
添加到<tr>
>
这会帮助你
document.querySelector('tbody tr').setAttribute("draggable", "true");
<table> <thead> <tr></tr> </thead> <tbody> <tr>here </tr> </tbody> </table>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.