# Any way to add a single word attribute to a dom element?

**URL:** <https://discourse.processing.org/t/any-way-to-add-a-single-word-attribute-to-a-dom-element/37173>\
**Category:** Beginners\
**Created:** [May 28, 2022, 4:19pm UTC](https://discourse.processing.org/t/any-way-to-add-a-single-word-attribute-to-a-dom-element/37173 "2022-05-28T16:19:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [May 28, 2022, 9:35pm UTC](https://discourse.processing.org/t/any-way-to-add-a-single-word-attribute-to-a-dom-element/37173/2 "2022-05-28T21:35:39Z")

</div>

> [@Set Focus to an DOM Input Field](https://discourse.processing.org/t/set-focus-to-an-dom-input-field/17140):
>
> How is it possible to select an input field directly by code, so that you can start typing right away? I have tried the following commands without success: input.focus(); input.style(‘focus’, true); input.style(‘focus’, ‘true’); input.style(‘focus()’, ‘true’); … [https://p5js.org/examples/dom-input-and-button.html](https://p5js.org/examples/dom-input-and-button.html) I would be very happy about a clue!

- [Tagged with focus() - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussions/tagged%3FTag=focus().html)

---

_[View the full topic](https://discourse.processing.org/t/any-way-to-add-a-single-word-attribute-to-a-dom-element/37173)._
