     do_update(socket, broadcast, attr: "class", set: value, on: selector)
   end
   defp do_update(socket, broadcast, :class, toggle: value, on: selector) do
-    {:ok, do_query(socket, selector, "toggleClass(\"#{value}\")", :update, broadcast)}    
+    {:ok, do_query(socket, selector, {:toggleClass, "(\"#{value}\")"}, :update, broadcast)}    
   end
   defp do_update(socket, broadcast, :class, set: values, on: selector) when is_list(values) do
     # switch classes: updates the attr: "class" string with replacement of class, if it is on the list
-    c = socket |> select(:classes, from: selector)
+    c = socket |> select(attrs: "class", from: selector)
     one_element_selector_only!(c, selector)
-    classes = c |> List.first()
+
+    classes = Map.values(c) |> Enum.map(&String.split/1) |> List.first()
     replaced = Enum.map(classes, fn c -> 
       if c in values do 
         next_in_list(values, c) 

  Additionally, `id` and `name` attributes are included into a Map.
  """
  def select(socket, options)
  def select(socket, [{method, argument}, from: selector]) when method in @methods_with_argument do
    do_query(socket, selector, jquery_method(method, argument), :select, @no_broadcast)
  end
  def select(_socket, [{method, argument}, from: selector]) do

    pair will launch the method named as the key with arguments taken from its value, so `text: "some"` becomes
    `.text("some")`.

  Object manipulation (`update/2`, `insert/2`, `delete/2`, `execute/2`) socket. 
  Query `select/2` returns list of found DOM object properties (list of htmls, values etc) or empty list when nothing 
  found.

