你好,我是新手,菜鸟,
<form action="bankPay.php" method="post" id="submitForm" target="_blank">
<input type="text" name="requestId" id="requestId" value=""/>
<input type="submit" value="提交" onclick="return check()" />
</form>
整个代码是这样,现在需要 id="requestId" 设置成随机字母或数字都可以,25位,每次刷新网页则自动生成,一个字符串变量,我看了你的回答,但不是很明白,你能不能详细写出来?非常感谢!
var requestId= document.getElementById('requestId');
var str="";
for(var i=0;i<24;i++){
str+=Math.floor(Math.random()*10)
}
requestId.value=str
var str="";
for(var i=0;i<24;i++){
str+=Math.floor(Math.random()*10)
}
requestId.value=str
这是随机填充的数字,字母同理
温馨提示:答案为网友推荐,仅供参考