2013年5月2日 星期四

[HTML][Javascript] Select of html tag - Delete option


 



[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 :

Related Posts:

0 意見:

張貼留言