Monday, April 21, 2008
Use className="myclass" rather than setAttribute("class", "myclass")
I had to build dynamic html using javascript and I came up with this problem - setAttribute("class", "myclass") didn't work. You should use className instead. The same with setAttribute("onclick","myfunc") - will not work. You should use onclick directly.
Subscribe to:
Post Comments (Atom)

1 comment:
Post a Comment