# Include a div/textarea "keywords" property!

**URL:** <https://es.discourse.group/t/include-a-div-textarea-keywords-property/551>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [November 16, 2020, 6:44am UTC](https://es.discourse.group/t/include-a-div-textarea-keywords-property/551 "2020-11-16T06:44:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seagat2011](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/seagat2011/32/367_2.png) [@Seagat2011](https://es.discourse.group/u/Seagat2011)\
**Post date:** [November 16, 2020, 6:44am UTC](https://es.discourse.group/t/include-a-div-textarea-keywords-property/551/1 "2020-11-16T06:44:39Z")

</div>

Include a div/textarea "keywords" property!

javascript can be used to build a code editor to edit javascript!  
One useful aspect of a code editor is, of course, stylized syntax-highlighting with color and line numbering, which are difficult still to implement using HTML/javascript: These require multiple contenteditable divs or textarea overlays with added keypress eventlisteners

This can however be simplified with the use of a div.keywords array property!

The property could enable automatic line numbering, and further customizations via CSS tags

Example

```javascript
div.keywords = ["var","let","with","in","of","for"] 
div.innerText = "let x = 100;\nlet y = 200;"
.
.
.
div.innerHTML; // "<div style='keyword lineNUMBER'>.1 <div style='keyword let'>let</div> x = 100;</div><div style='keyword lineNUMBER'>2. <div style='keyword let'>let</div> y = 200;"
// or...
div.innerHTML; // "<lineNUMBER>1. <keyword><let>let</let></keyword> x = 100;</lineNUMBER><lineNUMBER>2. <keyword><let>let</let></keyword> y = 200;</lineNUMBER>"

```

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [November 16, 2020, 9:25am UTC](https://es.discourse.group/t/include-a-div-textarea-keywords-property/551/2 "2020-11-16T09:25:10Z")

</div>

divs and textareas are part of HTML, not the JS language, so this wouldn't be the appropriate place to suggest it. See [https://participate.whatwg.org](https://participate.whatwg.org)

---

<div class="post-metadata">

**Author:** ![Seagat2011](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/seagat2011/32/367_2.png) [@Seagat2011](https://es.discourse.group/u/Seagat2011)\
**Post date:** [November 19, 2020, 9:38am UTC](https://es.discourse.group/t/include-a-div-textarea-keywords-property/551/3 "2020-11-19T09:38:11Z")

</div>

For those interested, you can follow the proposal at WHATWG dot ORG

Current Proposal  
[Include a div/textarea "keywords" property! - (proposed) 2020 HTML Standard](https://github.com/whatwg/html/issues/6152)

Main contributions  
[WHATWG.ORG on GIT HUB](https://github.com/whatwg)
