I am working on a project where i need to create an input with a placeholder, i.e.
<input type="text" placeholder="X"></input>
However, as far as the internet has told me, there is no way to do this. It would be nice if an argument could be added to the createInput(). Then the syntax could look like:
createInput([value], [placeholder], [type]).
one way to do this is:
createInput('value').attribute('placeholder', 'X');
Is placeholder a custom attribute or are you trying to do this:
<input type="text" value="placeholder">
Is adding the option of placeholder to the parameters of the createInput method something that needs to be done? Would be happy to add the necessary code/example if needed.
@digitalfrost placeholder is an existing attribute for input type of text (it shows a greyed out placeholder text when the field is empty)
@TanviKumar I think the method suggested by @Spongman is sufficient in this case, for me at least.
@limzykenneth - oh yes html5 - duh !
Most helpful comment
one way to do this is: