         propName = @nodes.propName
         self = this
 
-        wrapper = (info) ->
-            parent = info[0]
-            methods = info[1]
-            for method in methods
-                do (parent, method) ->
-                    console.log "Wrapping #{method}"
-                    oldStr = method + '__original'
-                    originalMethod = if parent[oldStr] then parent[oldStr] else parent[oldStr] = parent[method]
-                    parent[method] = ->
-                        rv = originalMethod.apply(this, arguments)
-                        if isDOMNode(rv) && rv[propName] == undefined
-                            nodes.add(rv)
-                        params =
-                            targetID : this[propName]
-                            rvID : rv[propName]
-                            method : method
-                            args : nodes.scrub(arguments)
-                        self.emit 'DOMUpdate', params
-                        #printMethodCall(this, method, argumentss)
-                        return rv
-
-        [[dom.Node.prototype, ['insertBefore', 'replaceChild',
-                               'appendChild', 'removeChild']],
-        [dom.Element.prototype, ['setAttribute', 'removeAttribute',
-                                 'setAttributeNode', 'removeAttributeNode']],
-        [dom.Document.prototype, ['createElement', 'createTextNode',
-                                  'createDocumentFragment', 'createComment',
-                                  'createAttribute']]].forEach(wrapper)
+        wrapProperty = (parent, prop) ->
+            console.log "Wrapping #{prop}"
+            originalMethod = parent.__lookupSetter__(prop)
+            if !originalMethod?
+                throw new Error "Missing a setter for #{prop}"
+            parent.__defineSetter__ prop, (value) ->
+                console.log "Setter for #{prop} called."
+                rv = originalMethod.call this, value
+                rvID = if rv? then rv[propName] else null
+                params =
+                    targetID : this[propName]
+                    rvID : rv
+                    prop : prop
+                    args : nodes.scrub([value])
+                self.emit 'DOMPropertyUpdate', params
+                return rv
+
+        wrapMethod = (parent, method) ->
+            console.log "Wrapping #{method}"
+            originalMethod = parent[method]
+            parent[method] = ->
+                console.log "#{method} called"
+                rv = originalMethod.apply(this, arguments)
+                if isDOMNode(rv) && rv[propName] == undefined
+                    nodes.add(rv)
+                rvUd = if rv? then rv[propName] else null
+                params =
+                    targetID : this[propName]
+                    rvID : rv[propName]
+                    method : method
+                    args : nodes.scrub(arguments)
+                # TODO: Change event name to show that this is a method, not prop
+                self.emit 'DOMUpdate', params
+                return rv
+
+        toWrap.forEach (info) ->
+            obj = info.object
+            info.methods?.forEach (method) ->
+                wrapMethod(obj, method)
+            info.properties?.forEach (prop) ->
+                wrapProperty(obj, prop)
 
     printMethodCall : (node, method, args) ->
         parentName = node.name || node.tagName

            ProcessExternalResources : ['script']#, 'frame', 'iframe'] # TODO:
            MutationEvents : '2.0'
            QuerySelector : false
        @wrapDOMMethods(@jsdom.dom.level3.html)
        @addDefaultHandlers(@jsdom.dom.level3.core)
        @setLanguageProcessor(@jsdom.dom.level3.core)

    addDefaultHandlers : (core) ->
        browser = @browser

                    console.log "Script succeeded"
                catch e
                    console.log "Script failed: #{e}"
                    console.log e
                    console.log e.stack

    wrapDOM : (toWrap) ->
        isDOMNode = (node) ->
            (typeof node.ELEMENT_NODE == 'number') &&
            (node.ELEMENT_NODE == 1)               &&
