Before we proceed, please take a moment to check out this fiddle link: http://jsfiddle.net/asif097/z6zsc
What I am aiming for is to have this jQuery code execute independently for each text input with the specified class. Currently, it is affecting both text input fields simultaneously.
Below is the jQuery code in question:
$(".first-name-input").after("<div class='first-name-input-value'>First Name</div>");
$(".first-name-input").focus(function(){
$(".first-name-input-value").hide();
});
$(".first-name-input").blur(function(){
if($(this).val() == ""){
$(".first-name-input-value").show();
}
});
$(".first-name-input-value").click(function(){
$(".first-name-input").focus();
});
I attempted an alternative approach as well: http://jsfiddle.net/z6zsc/1
However, my attempts were unsuccessful. Any suggestions on how to resolve this issue?
Thank you.