I want to make a text wink effect in textarea (only some words in a part can wink but not all). My textarea background is white. So I use textRange to select a part a text will wink and I do that:
var state=0;
var myTextRange;
/*
my code here to create myTextRange ...
/*
function wink()
{
if (state ==0)
{
myTextRange.execCommand("ForeColor", false, "red");
state =1;
}
else
{
myTextRange.execCommand("ForeColor", false, "white");
state =0;
}
}
//............................
<input type="button" value="wink" name="btWink" onclick = "setInterval("wink()",200)">
But it doesn't work. It seems the method execCommand("ForeColor", false, "white") doesn't work in textarea. Please help me! Thanks.