Solid
  • Core
  • Router
  • SolidStart
  • Meta
  • Basic reactivity
    • createEffect
    • createMemo
    • createResource
    • createSignal
  • Component APIs
    • children
    • createContext
    • createUniqueId
    • lazy
    • useContext
  • Components
    • <Dynamic>
    • <ErrorBoundary>
    • <For>
    • <Index>
    • <NoHydration>
    • <Portal>
    • <Show>
    • <Suspense>
    • <SuspenseList>
    • <Switch> / <Match>
  • JSX attributes
    • @once
    • attr:*
    • bool:*
    • classList
    • innerHTML
    • on:*
    • on*
    • prop:*
    • ref
    • style
    • textContent
    • use:*
  • Lifecycle
    • onCleanup
    • onMount
  • Reactive utilities
    • batch
    • catchError
    • createRoot
    • from
    • getOwner
    • indexArray
    • mapArray
    • mergeProps
    • observable
    • on
    • runWithOwner
    • splitProps
    • startTransition
    • untrack
    • useTransition
  • Rendering
    • DEV
    • hydrate
    • hydrationScript
    • isServer
    • render
    • renderToStream
    • renderToString
    • renderToStringAsync
  • Secondary primitives
    • createComputed
    • createDeferred
    • createReaction
    • createRenderEffect
    • createSelector
  • Store utilities
    • createMutable
    • createStore
    • modifyMutable
    • produce
    • reconcile
    • unwrap
  • Server utilities
    • getRequestEvent
JSX attributes

textContent

Edit this page

The textContent attribute is equivalent to the textContent DOM property. This attribute replaces all existing child nodes of the element with a single text node containing the provided string.

Using textContent can improve performance when the element's children are known to be exclusively text, as it bypasses the generic diffing process.

Report an issue with this page
Previous← style
Nextuse:* →
On this page
  1. Overview
Contribute
  1. Edit this page
  2. Report an issue with this page