webforms - How do I change the Input type Placeholder holder property via Javascript? -


I am using a simple HTML5 form optimized for the iPhone, and I'm showing error alerts within the text field On the placeholder property I do not know how it has reached through javascript.

Here is an example of the field HTML code:

I want the placeholder text (and maybe color?) Calls a form before calling a JavaScript valid format, but I It can not seem to change. I do not try any concept

Thanks

The answer was found!

Here is the JavaScript code that you can use with the text I have written:

Validate the function (form) {var name = theForm.name ; If (name.value == "") {name.setAttribute ('placeholder', "Please enter your name to continue"); return false; } Back true;}

The HTML input line is as follows:

  & lt; Input type = "text" id = "name" name = "name" value = "placeholder =" click here to enter your full name "tabindex = 1 / & gt; & Lt; / Div & gt;  

Comments