Fragment identifier (source code)

= Fragment identifier

A <fragment identifier> is the component introduced by `#` in a <URL>, supplying a reference within or associated with the identified resource. In `https://example.org/manual.html#setup`, `setup` is the fragment. Interpretation depends on the representation and its rules; an <HTML> element identifier is a familiar example, not the only possible meaning.<Uniform Resource Identifier (URI): Generic Syntax>[Section3.5: fragment semantics depend on media type]{ref}

The <Hypertext Transfer Protocol> target excludes the fragment. A browser requesting the preceding example requests the document without `#setup`, then can process the fragment locally. This differs from a <query string>, which can help identify the requested resource.<HTTP Semantics>[Section7.1: fragment excluded from target URI]{ref}

For an illustrative comparison, `manual.html#setup` and `manual.html#examples` can select different places in one retrieved document. Changing only the fragment therefore need not imply fetching two different document bodies. Conversely, a syntactically valid fragment does not prove that a matching destination exists in the current document.