wrapped setAttribute in try/catch to satisfy IE10

IE10 is not expecting a raw function as an attribute value so this wraps the attempt to set the value to a raw function in a try catch block

tested on IE6, 7, 8, 9, 10 beta using IETester
tested on latest Chrome and latest Firefox