I'm using JSF 2.0 and JQUERY 1.9. I'm trying to add an attribute to a component, but when the page is rendered, the attribute is not added.
Here is the jsf code for the component.
<h:form id="mainForm">
<h:inputText id="field" value="#{bean.value}"/>
</h:form>
and the jquery is like this:
<script type="text/javascript">
// <![CDATA[
window.onload=function(){
$("#mainForm:field").attr("placeholder","Fill me");
}
// <![CDATA[
</script>
This is being rendered like this:
<input id="mainForm:field" name="mainForm:field" type="text" value="">
Any idea on where am I wrong? Thanks!