 
       if twoWayBinding
         changeHandler = ->
-          return if getValue(context, keypath) == this[valueAttribute]
+          return if getValue(context, keypath) == this[valueProp]
           refreshContext()
           Twine.refreshImmediately()
         $(node).on 'input keyup change', changeHandler

          return unless node.checked
          setValue(context, keypath, node.value)
        else
          setValue(context, keypath, node[valueAttribute])

      keypath = keypathForKey(node, definition)
      twoWayBinding = valueAttribute != 'textContent' && node.type != 'hidden'

      if keypath[0] == '$root'
        context = rootContext

    addKey(rootContext) if node == rootNode
    keys.join('.')

  valuePropertyForNode = (node) ->
    name = node.nodeName.toLowerCase()
    if name in ['input', 'textarea', 'select']
      if node.getAttribute('type') in ['checkbox', 'radio'] then 'checked' else 'value'
