jquery 字符串切割函数substring的用法说明
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> jquery 字符串切割函数substring的用法说明 </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <META NAME="Author" CONTENT="Fanglor"> <META NAME="Keywords" CONTENT="jquery 字符串切割 函数 substring 用法"> <META NAME="Description" CONTENT="jquery 字符串切割 函数 substring 用法"> <script type="text/javascript" src="jquery.js"></script> <SCRIPT LANGUAGE="JavaScript"> <!-- function sclip () { if($("#txt1").val().length > 6) { $("#txt2").val($("#txt1").val().substring(0,6)); }else { $("#txt2").val($("#txt1").val()); } } //--> </SCRIPT> </HEAD> <input type="text" id="txt1" /> <input type="text" id="txt2" /> <input type="button" onClick="sclip();" value="do it ..."/> <BODY> </BODY> </HTML>
相关推荐
sunlizhen 2020-06-01
kuoying 2020-05-12
嗡汤圆 2020-05-02
好记忆也需烂 2020-04-18
heray0 2020-04-15
chouliqingke 2019-12-18
aanndd 2019-12-08
zangdaiyang 2019-12-05
chenxiangis 2019-11-01
ThinkingLink 2019-11-01
TMD咯MySQL 2019-09-05
kxr00 2012-07-14
Ongoingcre 2011-06-08
zjhqlmzldx 2011-05-10
hongsheyoumo 2010-03-02
huha 2009-11-12
MarkArch 2019-06-30