摘要:
第一次发现JavaScript中replace()方法如果直接用str.replace("-","!")只会替换第一个匹配的字符. 而str.replace(/\-/g,"!")则可以全部替换掉匹配的字符(g为全局标志)。replace() Thereplace()methodreturnsthestringthatresultswhenyoureplacetextmatchingitsfirstargument (aregularexpression)withthetextofthesecondargument(astring). 阅读全文
摘要:
jQuery获取Select选择的Text和Value:语法解释:1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发2. var checkText=$("#select_id").find("option:selected").text(); //获取Select选择的Text3. var checkValue=$("#select_id").val(); //获取Select选择的Value4. var check 阅读全文