原有问题的扩展!http://topic.csdn.net/u/20090830/16/edda40f4-69c4-473f-a499-a23a4d16648f.html
如网页中有<div id="box5" >
那么添加时就不能再次添加一个<div id="box5" >
只有添加<div id="box6" >假如这个还是存在那么就要再加1假如还有!!!!!
如网页中有<div id="box5" >
那么添加时就不能再次添加一个<div id="box5" >
只有添加<div id="box6" >假如这个还是存在那么就要再加1假如还有!!!!!
解决方案 »
- 请问jQuery如何返回某个特定id
- createlemen时t触发onClick事件的问题?
- 圖片、文件的上傳
- 求一段 “加入收藏” 的代码,要兼容性好的
- 急急急~~!!在线等。。。jsp高手请进。。。
- 用javascript控制table某几行显示隐藏造成的问题
- JavaScript如何实现UrlEncode
- 请问要如何在客户端判断一个文件的大小.
- 如何用javascript让实现打开的窗口是固定大小(不是全屏),必须是从地址栏中键入的网址,而不是新窗口?
- 请问如何设定出现告警框时不可键盘提交。急!(新手求救)
- 请问“中国 zhongguo”中间的空格是什么东东?不是空格
- 想要个好点的popup ad的源代码
var GUIDGenerator={p:function(w,n){var s="";for(var i=0;i<n;i++) s+="0";s+=""+w;s=s.substr((s.length-n),n);return s;},getGUID:function(){var d=new Date();return "_"+this.p(d.getFullYear(),4)+this.p(d.getMonth(),2)+this.p(d.getDate(),2)+this.p(d.getHours(),2)+this.p(d.getMinutes(),2)+this.p(d.getSeconds(),2)+this.p(100000*Math.random()+"",6);}}
alert("box"+GUIDGenerator.getGUID())
{
random: function(iFirstValue, iLastValue)
{
var iChoices = iLastValue - iFirstValue + 1;
return Math.floor(Math.random() * iChoices + iFirstValue);
}
,
newGuid: function()
{
var d = new Date();
return d.getTime() + d.getMilliseconds() + this.random(1,10000);
}
}; window.onload = function()
{
window.alert(Guid.newGuid());
}
</script>
<head>
<script lanague="javascript">
function createDiv(){
var oDiv=document.createElement("DIV");
oDiv.style.border = "15 groove black";
var DIVList=document.getElementsByTagName("DIV");
oDiv.ID="div"+(DIVList.length+1);
oDiv.innerText="层ID为:"+oDiv.ID;
document.body.appendChild(oDiv);
}</script>
</head>
<body UnLoad>
<div id="divId">tttt</div>
<input id="df" value="OK" onclick="createDiv();" type="button"/>
</body>
<html>
alert("存在");
}
else{
alert("不存在");
}