很好的代码 没用了 真可惜

貌似这两个函数是相对应而存在的,indexof是判断某个字符在字符串里是否存在,charat就是某个字符串中某个数字对应的字符是什么。
============================

if(input_t.indexOf(option_t) < 0){
                input_t += option_t+';';
                $(this).parents('.to-list').siblings('input').val(input_t);    

}else{                
                input_t = input_t.replace(option_t+';','');
                $(this).parents('.to-list').siblings('input').val(input_t);    

}  

----------------------------

indexOf 相当于 substr strpos 检测字符串中是否有某个字符
---------------
charAt(0123456678) 的
求出字符串的某个字符。

原文地址:https://www.cnblogs.com/qinqiu/p/4512455.html