Millisecond Forums

Ego Depletion Task

https://forums.millisecond.com/Topic13763.aspx

By danielle.allen09@Yahoo.com - 7/7/2014

I am trying to program an ego depletion task in which participants must 'cross out' all occurrences of the letter 'e' in a paragraph of text.  I want them to be able to click on letters in the text and the letter turn green; if they click it again, I would like the text to turn back to black.  I found this forum (http://www.millisecond.com/forums/Topic7396.aspx) which helped some, but this programs the entire word to turn green... I need the individual letters to turn green.

Any help on how to achieve this would be greatly appreciated!
By Dave - 7/7/2014

The approach to use is identical as the one outlined in the thread you referenced. The only difference is that you must represent every single *letter* as a separate <text> element instead of every single *word*.
By danielle.allen09@Yahoo.com - 7/8/2014

Okay, that is what I was doing.  It was just getting a little complicated with the positioning of the words so I wanted to make sure there wasn't a shortcut I was missing.  Thanks!
By Dave - 7/8/2014

No, there isn't any other shortcut, I'm afraid. The units you're interested in (here: individual letters) must be represented as distinct objects (here: a <text> element for each letter) for you to be able to interact with them. And yes, positioning all those objects can become a bit tedious. In that regard, note that elements can be positioned relative to each other (e.g. http://www.millisecond.com/forums/FindPost13663.aspx ).

Hope this clarifies.