String.prototype.substr() - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

The DOM (Document Object Model) API represents HTML and XML documents as trees of nodes. You can use the API to inspect and modify the structure and content of a document.

Avoid using this feature in new projects. HTML wrapper methods exist only for backwards compatibility. Use DOM APIs to create elements instead. This feature may be a candidate for removal from web standards or browsers.

String.prototype.substring()

String.prototype.slice()

Learn how to contribute

This page was last modified on Aug 21, 2026 by MDN contributors.

toLocaleLowerCase()

toLocaleUpperCase()

[Symbol.iterator]()

[Symbol.hasInstance]()

__defineGetter__()

__defineSetter__()

__lookupGetter__()

__lookupSetter__()

propertyIsEnumerable()

Community resources

Writing guidelines

a Creative Commons license

Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.