How to add JavaScript event to textarea without having direct access to it?

Posted by vince on Stack Overflow See other posts from Stack Overflow or by vince
Published on 2010-04-11T15:59:37Z Indexed on 2010/04/11 16:03 UTC
Read the original article Hit count: 249

Filed under:
|
|
|

Hi! I'm wondering how to add

onblur="hcb.watermark.blur(event)" onfocus="hcb.watermark.focus(event)" style="color: rgb(136, 136, 136);

to the following textarea without having direct access to it:

<textarea rows="4" id="HCB_textarea" name="content" class="commentbox hcb-shadow-r" onkeypress="hcb.delta(event)"/>

Could some additional JS do the job?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about event