How can i set random placeholder text from array of strings in jquery after document is loaded?
Now i have just “hardcoded” the setting for placeholder? But how to do it dynamically?
jQuery(function($) {
$(document).ready(function () {
var list = new Array();
list.push("1");
list.push("2");
$('#search').attr("placeholder","placeholder text");
});
});
Just how one time see 1, other 2…?
that would use any of the possibilities within
listand assign the placeholder a new random value from it.Example