JS Reference

JS by Category JS by Alphabet

JavaScript

JS Array JS Boolean JS Classes JS Date JS Error JS Global JS JSON JS Math JS Number JS Operators JS RegExp JS Statements JS String

Window

Window Object Window Console Window History Window Location Window Navigator Window Screen

HTML DOM

DOM Document DOM Element DOM Attributes DOM Events DOM Event Objects DOM HTMLCollection DOM Style
alignContent alignItems alignSelf animation animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationTimingFunction animationPlayState background backgroundAttachment backgroundColor backgroundImage backgroundPosition backgroundRepeat backgroundClip backgroundOrigin backgroundSize backfaceVisibility border borderBottom borderBottomColor borderBottomLeftRadius borderBottomRightRadius borderBottomStyle borderBottomWidth borderCollapse borderColor borderImage borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeft borderLeftColor borderLeftStyle borderLeftWidth borderRadius borderRight borderRightColor borderRightStyle borderRightWidth borderSpacing borderStyle borderTop borderTopColor borderTopLeftRadius borderTopRightRadius borderTopStyle borderTopWidth borderWidth bottom boxShadow boxSizing captionSide caretColor clear clip color columnCount columnFill columnGap columnRule columnRuleColor columnRuleStyle columnRuleWidth columns columnSpan columnWidth counterIncrement counterReset cursor direction display emptyCells filter flex flexBasis flexDirection flexFlow flexGrow flexShrink flexWrap cssFloat font fontFamily fontSize fontStyle fontVariant fontWeight fontSizeAdjust height isolation justifyContent left letterSpacing lineHeight listStyle listStyleImage listStylePosition listStyleType margin marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth objectFit objectPosition opacity order orphans outline outlineColor outlineOffset outlineStyle outlineWidth overflow overflowX overflowY padding paddingBottom paddingLeft paddingRight paddingTop pageBreakAfter pageBreakBefore pageBreakInside perspective perspectiveOrigin position quotes resize right scrollBehavior tableLayout tabSize textAlign textAlignLast textDecoration textDecorationColor textDecorationLine textDecorationStyle textIndent textOverflow textShadow textTransform top transform transformOrigin transformStyle transition transitionProperty transitionDuration transitionTimingFunction transitionDelay unicodeBidi userSelect verticalAlign visibility width wordBreak wordSpacing wordWrap widows zIndex

Web APIs

API Console API Fullscreen API Geolocation API History API MediaQueryList API Storage

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

CSSStyleDeclaration JS Conversion


자바스크립트 문자열 참조


자바스크립트 문자열

JavaScript 문자열은 "John Doe"와 같은 일련의 문자를 저장합니다.

문자열은 큰따옴표나 작은따옴표 안에 있는 모든 텍스트일 수 있습니다.

let carName1 = "Volvo XC60";
let carName2 = 'Volvo XC60';

문자열 인덱스는 0부터 시작합니다.

첫 번째 문자는 위치 0에 있고 두 번째 문자는 1에 있는 식입니다.

문자열에 대한 튜토리얼은 JavaScript 문자열 튜토리얼 을 읽어보세요 .


문자열 속성 및 메서드

일반적으로 "John Doe"와 같은 문자열은 개체가 아니므로 메서드나 속성을 가질 수 없습니다.

그러나 JavaScript에서는 메서드와 속성을 실행할 때 JavaScript가 문자열을 객체로 취급하기 때문에 메서드와 속성을 문자열에서도 사용할 수 있습니다.


JavaScript 문자열 메서드

Method Description
charAt() Returns the character at a specified index (position)
charCodeAt() Returns the Unicode of the character at a specified index
concat() Returns two or more joined strings
endsWith() Returns if a string ends with a specified value
fromCharCode() Returns Unicode values as characters
includes() Returns if a string contains a specified value
indexOf() Returns the index (position) of the first occurrence of a value in a string
lastIndexOf() Returns the index (position) of the last occurrence of a value in a string
localeCompare() Compares two strings in the current locale
match() Searches a string for a value, or a regular expression, and returns the matches
repeat() Returns a new string with a number of copies of a string
replace() Searches a string for a value, or a regular expression, and returns a string where the values are replaced
search() Searches a string for a value, or regular expression, and returns the index (position) of the match
slice() Extracts a part of a string and returns a new string
split() Splits a string into an array of substrings
startsWith() Checks whether a string begins with specified characters
substr() Extracts a number of characters from a string, from a start index (position)
substring() Extracts characters from a string, between two specified indices (positions)
toLocaleLowerCase() Returns a string converted to lowercase letters, using the host's locale
toLocaleUpperCase() Returns a string converted to uppercase letters, using the host's locale
toLowerCase() Returns a string converted to lowercase letters
toString() Returns a string or a string object as a string
toUpperCase() Returns a string converted to uppercase letters
trim() Returns a string with removed whitespaces
valueOf() Returns the primitive value of a string or a string object

메모

모든 문자열 메서드는 새 값을 반환합니다.

그들은 원래 변수를 변경하지 않습니다.

자바스크립트 문자열 속성

Property Description
constructor Returns the string's constructor function
length Returns the length of a string
prototype Allows you to add properties and methods to an object


문자열 HTML 래퍼 메서드

HTML 래퍼 메서드는 HTML 태그 안에 래핑된 문자열을 반환합니다.

이는 표준 방법이 아니며 예상대로 작동하지 않을 수 있습니다.

Method Description
anchor() Displays a string as an anchor
big() Displays a string using a big font
blink() Displays a blinking string
bold() Displays a string in bold
fixed() Displays a string using a fixed-pitch font
fontcolor() Displays a string using a specified color
fontsize() Displays a string using a specified size
italics() Displays a string in italic
link() Displays a string as a hyperlink
small() Displays a string using a small font
strike() Displays a string with a strikethrough
sub() Displays a string as subscript text
sup() Displays a string as superscript text