Movatterモバイル変換


[0]ホーム

URL:


Menu
×
See More 
Sign In
+1 Get Certified Upgrade For Teachers Spaces Get Certified Upgrade For Teachers Spaces
   ❮     
     ❯   

JS Reference

JS by CategoryJS by Alphabet

JavaScript

JS ArraysJS BooleanJS ClassesJS DatesJS ErrorJS GlobalJS IteratorsJS JSONJS MapsJS MathJS NumbersJS ObjectsJS OperatorsJS AssignmentJS ArithmeticJS ComparisonJS Logical OperatorsJS Bitwise OperatorsJS Misc OperatorsJS PrecedenceJS PromisesJS ProxyJS ReflectJS RegExp PatternsJS RegExp ReferenceJS SetsJS StatementsJS StringsJS Typed ArraysJS Typed Reference

Window

Window ObjectWindow ConsoleWindow HistoryWindow LocationWindow NavigatorWindow Screen

HTML DOM

HTML DocumentsHTML Elements
accessKeyaddEventListener()after()append()appendChild()attributesbefore()blur()childElementCountchildNodeschildrenclassListclassNameclick()clientHeightclientLeftclientTopclientWidthcloneNode()closest()compareDocumentPosition()contains()contentEditabledirfirstChildfirstElementChildfocus()getAttribute()getAttributeNode()getBoundingClientRect()getElementsByClassName()getElementsByTagName()hasAttribute()hasAttributes()hasChildNodes()idinnerHTMLinnerTextinsertAdjacentElement()insertAdjacentHTML()insertAdjacentText()insertBefore()isContentEditableisDefaultNamespace()isEqualNode()isSameNode()isSupported()langlastChildlastElementChildmatches()namespaceURInextSiblingnextElementSiblingnodeNamenodeTypenodeValuenormalize()offsetHeightoffsetWidthoffsetLeftoffsetParentoffsetTopouterHTMLouterTextownerDocumentparentNodeparentElementpreviousSiblingpreviousElementSiblingquerySelector()querySelectorAll()remove()removeAttribute()removeAttributeNode()removeChild()removeEventListener()replaceChild()scrollHeightscrollIntoView()scrollLeftscrollTopscrollWidthsetAttribute()setAttributeNode()styletabIndextagNametextContenttitle
HTML AttributesHTML CollectionHTML NodeListHTML DOMTokenListHTML Styles
alignContentalignItemsalignSelfanimationanimationDelayanimationDirectionanimationDurationanimationFillModeanimationIterationCountanimationNameanimationTimingFunctionanimationPlayStatebackgroundbackgroundAttachmentbackgroundClipbackgroundColorbackgroundImagebackgroundOriginbackgroundPositionbackgroundRepeatbackgroundSizebackfaceVisibilityborderborderBottomborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomStyleborderBottomWidthborderCollapseborderColorborderImageborderImageOutsetborderImageRepeatborderImageSliceborderImageSourceborderImageWidthborderLeftborderLeftColorborderLeftStyleborderLeftWidthborderRadiusborderRightborderRightColorborderRightStyleborderRightWidthborderSpacingborderStyleborderTopborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopStyleborderTopWidthborderWidthbottomboxShadowboxSizingcaptionSidecaretColorclearclipcolorcolumnCountcolumnFillcolumnGapcolumnRulecolumnRuleColorcolumnRuleStylecolumnRuleWidthcolumnscolumnSpancolumnWidthcounterIncrementcounterResetcssFloatcursordirectiondisplayemptyCellsfilterflexflexBasisflexDirectionflexFlowflexGrowflexShrinkflexWrapfontfontFamilyfontSizefontStylefontVariantfontWeightfontSizeAdjustheightisolationjustifyContentleftletterSpacinglineHeightlistStylelistStyleImagelistStylePositionlistStyleTypemarginmarginBottommarginLeftmarginRightmarginTopmaxHeightmaxWidthminHeightminWidthobjectFitobjectPositionopacityorderorphansoutlineoutlineColoroutlineOffsetoutlineStyleoutlineWidthoverflowoverflowXoverflowYpaddingpaddingBottompaddingLeftpaddingRightpaddingToppageBreakAfterpageBreakBeforepageBreakInsideperspectiveperspectiveOriginpositionquotesresizerightscrollBehaviortableLayouttabSizetextAligntextAlignLasttextDecorationtextDecorationColortextDecorationLinetextDecorationStyletextIndenttextOverflowtextShadowtextTransformtoptransformtransformOrigintransformStyletransitiontransitionPropertytransitionDurationtransitionTimingFunctiontransitionDelayunicodeBidiuserSelectverticalAlignvisibilitywidthwordBreakwordSpacingwordWrapwidowszIndex

HTML Events

HTML EventsHTML Event ObjectsHTML Event PropertiesHTML Event Methods

Web APIs

API CanvasAPI ConsoleAPI FetchAPI FullscreenAPI GeolocationAPI HistoryAPI MediaQueryListAPI StorageAPI ValidationAPI Web

HTML Objects

<a><abbr><address><area><article><aside><audio><b><base><bdo><blockquote><body><br><button><canvas><caption><cite><code><col><colgroup><datalist><dd><del><details><dfn><dialog><div><dl><dt><em><embed><fieldset><figcaption><figure><footer><form><head><header><h1> - <h6><hr><html><i><iframe><img><ins><input> button<input> checkbox<input> color<input> date<input> datetime<input> datetime-local<input> email<input> file<input> hidden<input> image<input> month<input> number<input> password<input> radio<input> range<input> reset<input> search<input> submit<input> text<input> time<input> url<input> week<kbd><label><legend><li><link><map><mark><menu><menuitem><meta><meter><nav><object><ol><optgroup><option><output><p><param><pre><progress><q><s><samp><script><section><select><small><source><span><strong><style><sub><summary><sup><table><tbody><td><tfoot><th><thead><tr><textarea><time><title><track><u><ul><var><video>

Other References

CSSStyleDeclarationJS Conversion


JavaScript String codePointAt()

Examples

Get code point value at the first position in a string:

let text = "HELLO WORLD";
let code = text.codePointAt(0);
Try it Yourself »

Get the code point value at the second position:

let text = "HELLO WORLD";
let code = text.codePointAt(1);
Try it Yourself »

More examples below.


Description

ThecodePointAt() method returns the Unicode value atan index (position) in a string.

The index of the first position is 0, the second is 1, ....

See Also:

The charCodeAt() Method

The charAt() Method

The indexOf() Method

The lastIndexOf() Method

Unicode

For more information about Unicode Character Sets, visit ourUnicode Reference.


Difference Between charCodeAt() and codePointAt()

charCodeAt() is UTF-16,codePointAt()is Unicode.

charCodeAt() returns a number between 0 and 65535.

Both methods return an integer representing the UTF-16 code of a character,but onlycodePointAt() can return the full value of a Unicode value greather 0xFFFF (65535).

For more information about Unicode Character Sets, visit ourUnicode Reference.


Syntax

string.codePointAt(index)

Parameters

ParameterDescription
indexOptional.
The index (position) in a the string.
Default value = 0.

Return Value

TypeDescription
NumberThe code point value at the specified index.
undefined if the index is invalid.


More Examples

Get the code point value at the last position:

let text = "HELLO WORLD";
let code = text.charCodeAt(text.length-1);
Try it Yourself »

Get the code point value at the 15th position:

let text = "HELLO WORLD";
let code = text.charCodeAt(15);
Try it Yourself »

Browser Support

codePointAt() is an ECMAScript6 (ES6 2015) feature.

JavaScript 2015 is supported in all browsers sinceJune 2017:

Chrome
51
Edge
15
Firefox
54
Safari
10
Opera
38
May 2016Apr 2017Jun 2017Sep 2016Jun 2016


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted ourterms of use,cookies andprivacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved.W3Schools is Powered by W3.CSS.


[8]ページ先頭

©2009-2025 Movatter.jp