I have several textareas on my page and I use jquery focus function to clear the textarea when someone clicks it. Here is the code:
$("textarea.text").focus(function() {
if( $(this).attr("has_desc") == "false" ) {
$(this).val("");
$(this).attr("has_desc", "true");
}
});
The user has the ability to dynamically add new textareas and I use appendTo function to add new one. The problem is that the above code doesn't work for the appended textareas! The HTML code is exactly the same as for the forms that aren't added dynamically! Can anyone please tell what is the problem?