TextEncoder: encode() method - Web APIs | MDN (2024)

The TextEncoder.encode() method takes a string as input, and returns a Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.

Syntax

js

encode(string)

Parameters

string

A string containing the text to encode.

Return value

A Uint8Array object.

Examples

html

<p class="source">This is a sample paragraph.</p><p class="result">Encoded result:</p>

js

const sourcePara = document.querySelector(".source");const resultPara = document.querySelector(".result");const string = sourcePara.textContent;const textEncoder = new TextEncoder();let encoded = textEncoder.encode(string);resultPara.textContent += encoded;

Specifications

Specification
Encoding Standard
# ref-for-dom-textencoder-encode①

Browser compatibility

BCD tables only load in the browser

See also

TextEncoder: encode() method - Web APIs | MDN (2024)
Top Articles
Lido Learning Shuts Down: What happened to Lido Learning?
props.ogPageTitle
7 C's of Communication | The Effective Communication Checklist
Northern Counties Soccer Association Nj
Nybe Business Id
Activities and Experiments to Explore Photosynthesis in the Classroom - Project Learning Tree
My Boyfriend Has No Money And I Pay For Everything
Retro Ride Teardrop
Victoria Secret Comenity Easy Pay
Craigslist In Fredericksburg
The Rise of Breckie Hill: How She Became a Social Media Star | Entertainment
Ella Eats
Ree Marie Centerfold
What to do if your rotary tiller won't start – Oleomac
What is Cyber Big Game Hunting? - CrowdStrike
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Northeastern Nupath
Aspen Mobile Login Help
Popular Chinese Restaurant in Rome Closing After 37 Years
Mc Donald's Bruck - Fast-Food-Restaurant
Apartments / Housing For Rent near Lake Placid, FL - craigslist
Soul Eater Resonance Wavelength Tier List
Dr. Nicole Arcy Dvm Married To Husband
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
Webworx Call Management
SOGo Groupware - Rechenzentrum Universität Osnabrück
Aes Salt Lake City Showdown
Enduring Word John 15
How do you get noble pursuit?
Gncc Live Timing And Scoring
Helpers Needed At Once Bug Fables
Motor Mounts
South Florida residents must earn more than $100,000 to avoid being 'rent burdened'
47 Orchid Varieties: Different Types of Orchids (With Pictures)
Umiami Sorority Rankings
Eleceed Mangaowl
Myfxbook Historical Data
Mixer grinder buying guide: Everything you need to know before choosing between a traditional and bullet mixer grinder
Tillman Funeral Home Tallahassee
9 oplossingen voor het laptoptouchpad dat niet werkt in Windows - TWCB (NL)
Riverton Wyoming Craigslist
Firestone Batteries Prices
Powerspec G512
How Big Is 776 000 Acres On A Map
N33.Ultipro
Theater X Orange Heights Florida
Join MileSplit to get access to the latest news, films, and events!
Washington Craigslist Housing
Rocket Bot Royale Unblocked Games 66
Cheryl Mchenry Retirement
Les BABAS EXOTIQUES façon Amaury Guichon
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 6083

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.