Please check this code, and tell me what I'm missing, I just want to change the color of placeholder after clicking on a button. but I can't figure it out what's wrong.
function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < 5; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
$(".submit_btn").click(function()
{
if($(".txt_style").text()!="")
{
alert(makeid());
}
else
{
$(".txt_style").attr("placeholder", "Please enter your email address");
$('input::-webkit-input-placeholder').css("color", "red");
}
});