String.prototype.strike()
Deprecated
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. >
Consider using the following features instead: DOM. >
String ê°ì strike() ë©ìëë 문ìì´ì ì·¨ìì ì²ë¦¬ë í
ì¤í¸ë¡ íìíê² ë§ëë <strike> ìì(<strike>str</strike>)ì í¬í¨íë 문ìì´ì ìì±í©ëë¤.
ì°¸ê³ :
모ë HTML ëí¼ ë©ìëë ë ì´ì ì¬ì©ëì§ ìì¼ë©° í¸íì± ëª©ì ì¼ë¡ë§ íì¤íëììµëë¤. strike()ì ê²½ì°, <strike> ìì ìì²´ê° HTML ëª
ì¸ìì ì ì¸ëì기ì ë ì´ì ì¬ì©í´ìë ìë©ëë¤. ì¹ ê°ë°ìë¤ì ìì ë 컨í
ì¸ ìë <del>를, ë ì´ì ì ííì§ ìê±°ë ì°ê´ëì§ ìì 컨í
ì¸ ìë <s>를 ëì ì¬ì©í´ì¼ í©ëë¤.
구문
strike()
매ê°ë³ì
ìì.
ë°í ê°
<strike> ìì íê·¸ë¡ ììíë 문ìì´, ê·¸ ë¤ì str ë´ì©, ê·¸ ë¤ì </strike> ë íê·¸ë¡ ëëë 문ìì´ì
ëë¤.
ìì
>strike() ì¬ì©í기
ìë ì½ëë HTML 문ìì´ì ìì±í ë¤ì documentì body를 í´ë¹ 문ìì´ë¡ ëì²´í©ëë¤.
const contentString = "Hello, world";
document.body.innerHTML = contentString.strike();
ì´ë ë¤ì HTMLì ìì±í©ëë¤.
<strike>Hello, world</strike>
ê²½ê³ :
strikeê° ë ì´ì ì í¨í ììê° ìë기 ë문ì ì´ ë§í¬ì
ì ì í¨íì§ ììµëë¤.
strike()를 ì¬ì©íì¬ HTML í
ì¤í¸ë¥¼ ì§ì ìì±íë ëì document.createElement()ì ê°ì DOM API를 ì¬ì©í´ì¼ í©ëë¤. ìëì ì를 ì°¸ê³ íì¸ì.
const contentString = "Hello, world";
const elem = document.createElement("s");
elem.innerText = contentString;
document.body.appendChild(elem);
ëª ì¸ì
| Specification |
|---|
| ECMAScript® 2027 Language Specification > # sec-string.prototype.strike > |