   end
 
   @doc """
+  Broadcasting version of `set_attr/3`.
+
+  It does exactly the same as `set_attr/3`, but instead of pushing the message to the current
+  browser, it broadcasts it to all connected users.
+
+  Always returns `{:ok, :broadcasted}`.
+
+  See `Drab.Core.broadcast_js/2` for broadcasting options.  
+  """
+  @spec broadcast_attr(Drab.Core.subject(), String.t(), map | Keyword.t()) :: Drab.Core.result()
+  def broadcast_attr(subject, selector, attributes) when is_list(attributes) or is_map(attributes) do
+    # set_prop(socket, selector, %{"attributes" => Map.new(attributes)})
+    broadcast_js(subject, set_js(selector, %{"attributes" => Map.new(attributes)}))
+  end
+
+  @doc """
+  Exception-throwing version of `broadcast_attr/3`
+  """
+  @spec broadcast_attr!(Drab.Core.subject(), String.t(), map | Keyword.t()) :: Drab.Core.return() | no_return
+  def broadcast_attr!(subject, selector, attributes) when is_list(attributes) or is_map(attributes) do
+    broadcast_js(subject, set_js(selector, %{"attributes" => Map.new(attributes)}))
+  end
+
+  @doc """
   Helper for setting the dataset of elements. A shorthand for:
 
       set_prop(socket, selector, %{"dataset" => dataset})

    set_prop! socket, selector, innerHTML: html
  end

end

  end

  @doc """
  Broadcasting version of `set_data/3`.

  It does exactly the same as `set_data/3`, but instead of pushing the message to the current
  browser, it broadcasts it to all connected users.

  Always returns `{:ok, :broadcasted}`.

  See `Drab.Core.broadcast_js/2` for broadcasting options.  
  """
  @spec broadcast_data(Drab.Core.subject(), String.t(), map | Keyword.t()) :: Drab.Core.bcast_result()
  def broadcast_data(subject, selector, dataset) when is_list(dataset) or is_map(dataset) do
    broadcast_js(subject, set_js(selector, %{"dataset" => Map.new(dataset)}))
  end

  @doc """
  Exception-throwing version of `broadcast_data/3`
  """
  @spec broadcast_data!(Drab.Core.subject(), String.t(), map | Keyword.t()) :: Drab.Core.return() | no_return
  def broadcast_data!(subject, selector, dataset) when is_list(dataset) or is_map(dataset) do
    broadcast_js!(subject, set_js(selector, %{"dataset" => Map.new(dataset)}))
  end

  @doc """
  Parses the specified text as HTML and inserts the resulting nodes into the DOM tree at
  a specified position.

