I am looking to match id for inputText in JSF using Jquery. But it does not work and I do not know why.
JSF CODE
<h:inputText id="email" value="#{userActionManager.newUser.emailID}">
</h:inputText>
Jquery CODE
$(document).ready(function() {
$("inputText[id^=email]").each(function(){
this.value = $(this).attr('title');
$(this).addClass('text-label');
$(this).focus(function(){
if(this.value == $(this).attr('title')) {
this.value = " ";
$(this).removeClass('text-label');
}
});
$(this).blur(function(){
if(this.value == '') {
this.value = $(this).attr('title');
$(this).addClass('text-label');
}
});
});
});
I need inputText[id^=email] to be working to acces the inputText id used in JSF code. Please Help...