mary jane
mary jane

Reputation: 542

Adding dojo parameter to exsisting field

I have a form created in php and I want to add some attributes to it from js dojo.

I can retrive the textfield by it's id (dojo.byId), but how to add the placeholder attribute to the node without creating a new one and replacing the previous field?

Upvotes: 1

Views: 124

Answers (1)

phusick
phusick

Reputation: 7352

dojo.byId("textbox1").placeholder = "I'm your placeholder";

See it in action: http://jsfiddle.net/phusick/ww98a/

Upvotes: 2

Related Questions