1

I have a text that when it's clicked, it becomes a textarea using the editable function from js. How can I add a placeholder text to that area? i tried to search it in the dom using $('textarea') but I had no luck. I also use backbone model and view to generate the views.

Sam
  • 7,252
  • 16
  • 46
  • 65
Cristian Holdunu
  • 1,880
  • 1
  • 18
  • 43

1 Answers1

1

I'll update the selector in a bit, but right now this will work:

$("form :text").attr("placeholder",what you want);

html gotcha, make sure the <textarea></textarea> are on the same line, otherwise "\n" will be the default value regardless of the placeholder value.

Community
  • 1
  • 1
DefyGravity
  • 5,681
  • 5
  • 32
  • 47