隐藏域里有12,34,39,48,2,33,49,9
这些ID
点击复选框,选中后增加一个,把勾上的取消就会减少一个
例如,我把id是9的打勾的给取消了
怎么让隐藏域里把那个9的给删除掉??
如果是简单的replace行不通,会把其他带有9的都给干掉了
求一个解决思路
------解决方案--------------------------------------------------------
得到隐藏域
hide = document.getElementById("Hidden1").value
假如
hide = "12,34,39,48,2,33,49,9"
hide = "," + hide + ","
hide = hide.replace(","+"9" + ",",",")