[HTML][Javascript] Select of html tag - Delete option
The value of i must point to the max length.
And countdown to 0.
cf.remove will work, otherwise don't work properly.
var cf = document.getElementById("happy");
for (i = cf.length - 1; i >= 0; i--)
{
if (select == cf.options[i].text)
{
cf.remove(i);
}
}
Reference :
0 意見:
張貼留言