     else
       if typeof queryTokens is 'string'
         queryTokens = queryTokens.split /(?![\w\-]+|$)/
-      else
+      else if not raw
         queryTokens = queryTokens.concat() # duplicate
       if queryTokens[0] and /^\w/.test queryTokens[0]
         tagName = queryTokens.shift()
       else
         tagName = 'div'
     element = document.createElement tagName
-    $element = $(element)
+    $element = $(element) unless raw
+
+    # set attributes
+    $element.attr attrs if not raw and attrs
 
     # setup id, class
     while queryTokens.length

      if tokenStr == ' '
        if queryTokens[0].indexOf(' ') < 0
          # nested element without tag-name
          innerContents = $.egen(queryTokens, null, innerContents)
          queryTokens = []
        continue
      token = tokenStr.match(/([^\w\-])([\w\-]+)/)
      unless token and token.length == 3


  document = window.document

  $.egen = $.eGen = (queryTokens, attrs, innerContents, raw) ->
    tagName = id = null

    # generate element
