<html>
<head>
<script>
function doStartAll() {
var allCheck = document.updateBusinessForm.getElementsByTagName("input");
var checkList='';
for(var i=0; i<allCheck.length; i++){
var tagBody = allCheck[i];
if(tagBody.getAttribute("name").startWith('name1')){
checkList += tagBody.value + '|';
}
}
alert(checkList);
}
String.prototype.startWith=function(str){
if(str==null||str==""||this.length==0||str.length>this.length)
return false;
if(this.substr(0,str.length)==str)
return true;
else
return false;
return true;
}
String.prototype.endWith=function(str){
if(str==null||str==""||this.length==0||str.length>this.length)
return false;
if(this.substring(this.length-str.length)==str)
return true;
else
return false;
return true;
}
</script>
</head>
<body>
<form name="updateBusinessForm" method="get" action="businessUpdateStateEpaper.do">
<input name="name1.a" value="a"/>
<input name="name1.b" value="b"/>
<input name="name1.c" value="c"/>
<input name="name1.d" value="d"/>
<input type="submit" class="button" id="" value="启用" onClick="doStartAll();"/>
</form>
</body>
</html>
分享到:
相关推荐
JavaScript采用正则表达式实现startWith、endWith效果函数 代码如下:String.prototype.startWith=function(str){ var reg=new RegExp(“^”+str); return reg.test(this); } String.prototype.endWith=function...
### JavaScript自定义startWith()和endWith()方法详解 #### 一、引言 在JavaScript中,`String.prototype.startsWith()` 和 `String.prototype.endsWith()` 方法分别用于判断字符串是否以指定的子串开头或结尾。这...
一、采用正则表达式实现startWith、endWith效果函数 代码如下: String.prototype.startWith=function(str){ var reg=new RegExp(“^”+str); return reg.test(this);... } 二、JavaScript实现startWith、endWith效果
We will dive into new concepts in JavaScript development, and see how paradigms such as async/await help with modern Node.js application development. By the end of this book, you will be building ...
startWith.js 判断是否以某个字符串开头 endWith.js 判断是否以某个字符串结束 HtmlEncode.js 转义html标签 dateFormat.js 时间日期格式转换 timeFormat.js 时间个性化输出功能 isDigit.js 判断是否为数字类型 ...
With Jump Start Node.js, you’ll pick up the basics of Node.js, and learn to put it to work right away. Node.js is different because it allows you to write front- and back-end code: that means, all ...
You’ll learn the SPA design approach, and then start exploring new techniques like structured JavaScript and responsive design. And you’ll learn how to capitalize on trends like server-side ...
You will see how using Node.js can be a fun and rewarding experience - start today with Beginning Node.js. What you’ll learn • Learn how JavaScript can help you be highly productive as a full-...
You'll start with learning domain-driven concepts and working with UML diagrams. You'll follow this up with how to set up your projects and utilize the TDD tools. Different objects and prototypes ...
With Jump Start Node.js, you’ll pick up the basics of Node.js, and learn to put it to work right away. Node.js is different because it allows you to write front- and back-end code: that means, all ...
What are static site generators, why do you need them, and how are they better than ...By the end of the book, you will have built your own static website by leveraging the power of Vue.js and VuePress.
- `startWith(s)`:检查字符串是否以指定的子字符串`s`开头。 - `endWith(s)`:检查字符串是否以指定的子字符串`s`结尾。 - `HtmlEncode(text)`:对字符串中的特殊字符进行转义,防止HTML注入。 2. 正则表达式:...
Also, you will dive into migration, testing and integrating Truffle with the use of popular JavaScript frameworks. Lastly, you will ship your decentralized application and package it into a product. ...
Key FeaturesA step by step guide, which will provide you with a thorough discussion on the analysis and design of fundamental JavaScript data structuresGet a better understanding of advanced concepts ...
You'll start with in-depth explanations of D3's out-of-the-box layouts, along with dozens of practical use cases that align with different types of visualizations. Then, you'll explore practical ...
By the end of this book, you’ll be equipped with all the skills you need to build your first fully featured application. This book will be invaluable if you are investigating Node.js frameworks or ...
- `substring(start, end)` 和 `slice(start, end)` 方法用于截取字符串的一部分。 ```javascript console.log(str.substring(1, 4)); // 输出ell console.log(str.substring(1)); // 输出ello,world console....