Home / Function/ set_attribute() — svelte Function Reference

set_attribute() — svelte Function Reference

Architecture documentation for the set_attribute() function in operations.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  f4910c1d_4706_d871_1b71_4336dcb2d00c["set_attribute()"]
  9a9bbc27_46b6_021c_6d77_f736ed4b40f0["operations.js"]
  f4910c1d_4706_d871_1b71_4336dcb2d00c -->|defined in| 9a9bbc27_46b6_021c_6d77_f736ed4b40f0
  9377bbc7_f1f5_56f6_87e1_cfa79859a6b7["fragment_from_tree()"]
  9377bbc7_f1f5_56f6_87e1_cfa79859a6b7 -->|calls| f4910c1d_4706_d871_1b71_4336dcb2d00c
  style f4910c1d_4706_d871_1b71_4336dcb2d00c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/client/dom/operations.js lines 266–272

export function set_attribute(element, key, value = '') {
	if (key.startsWith('xlink:')) {
		element.setAttributeNS('http://www.w3.org/1999/xlink', key, value);
		return;
	}
	return element.setAttribute(key, value);
}

Domain

Subdomains

Frequently Asked Questions

What does set_attribute() do?
set_attribute() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/dom/operations.js.
Where is set_attribute() defined?
set_attribute() is defined in packages/svelte/src/internal/client/dom/operations.js at line 266.
What calls set_attribute()?
set_attribute() is called by 1 function(s): fragment_from_tree.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free