2007-12-09から1日間の記事一覧
new Element('button',{onclick:"alert('hello world')"}) とやれば、 <button onclick="alert('hello world')"></button> になる。と思ったらダメだった。 Firefoxは大丈夫ですが、IEで動きません。 内部でsetAttributeが使われていて、setAttribute(onclick,"alert('hello world')")となるからです。 IEでは…