indexOf,substring,select

indexOf()方法可以判断某个字符在字符串出现的位置,如果没有出现,就返回-1

如:

a.indexOf("=")判断“=”在a中出现的位置,如果a中没有“=”,则返回-1


substring(),获取起始位置和结束位置之间的字符内容

substring(start,end),start必须写,end如果不写则默认显示其实到结束


select

获取select中option的value值和option的文本的值

选中的value值:$("#id").val();

选中的文本的值:$("#id option:selected").text();

猜你喜欢

转载自blog.csdn.net/zy21131437/article/details/80746395