I’m thinking about how can I implement onfocus and onblur effects in my input field in JSF 2.0.

I do the following in HTML:
<input type="text" name="name" id="name" size="30" value="Name (required)"
onblur="if (this.value == ''){this.value = 'Name (required)'; }"
onfocus="if (this.value == 'Name (required)') {this.value = ''; }"
class="text-input" />
Now I’m wondering how I could do this in JSF 2.0. Does anyone have an idea?
EDIT
I’m trying the attribute ‘onblur’ and ‘onfocus’ but still nothing appearing in my input field.
<h:inputText onblur="Nome" onfocus="" ></h:inputText>
You can just use the same attributes as your HTML sample. The following piece of code works just fine: