2

例如,如果我正在这样做a.setAttribute("begin", b+".focus");,它会显示在开发工具的 HTML 选项卡中,但它会被行为完全忽略(如果我begin="time1.focus"直接在 html 中添加它就可以了)。

你如何将这些动态添加的属性暴露给行为?
还有其他方法可以添加它们吗?(createElement 和 document.write 除外)

PS:我已经尝试过使用 createAttribute + nodeValue + setAttributeNode 无济于事。

4

1 回答 1

1

秘诀是顺序:您需要在添加行为的类或使用之前addBehavior设置属性。

于 2011-12-31T03:15:37.827 回答