PDA

View Full Version : how to add a behavior?


percepts
09-15-2006, 07:35 AM
Just wondering if there is a simple way to add a behaviour (.htc file) to a div from javascript in IE6.

The addBehavior method doesn't seem to work for me. I get message

"object doesn't support this property or method"

and example of it not working can be see here:

http://www.java2s.com/Code/JavaScript/HTML/UsingaddBehaviorandremoveBehavior.htm

did it only work in earlier versions of IE?

Oh, and I know how to do it from css but just wondering if it can be done from javascript.

percepts
09-15-2006, 08:18 AM
Sorted. Sometimes you can't see the wood for the trees. Its just object.style.behavior