Reputation: 1183
This is a branch question from Typewriter Effect with jQuery
I'd like to sequentially inject and clear each string from the array into the 'placeholder' element on an html form. The function currently writes and clears each string into an empty span element.
No experience with jQuery :/, any tips on how to go about doing this?
Upvotes: 0
Views: 570
Reputation: 57105
Use .attr()
$(element).attr('placeholder','Write text here');
to get value of placeholder
attribute in jQuery
var placeholder_value = $(element).attr('placeholder');
Better use .prop()
$(element).prop('placeholder','Write text here');
to get value of placeholder
attribute in jQuery
var placeholder_value = $(element).prop('placeholder');
Commented by Tats_innit
Read
Upvotes: 3