Cristian Holdunu
Cristian Holdunu

Reputation: 1918

jQuery editable add plecholder text

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.

Upvotes: 1

Views: 140

Answers (1)

DefyGravity
DefyGravity

Reputation: 6011

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.

Upvotes: 1

Related Questions