JSDM

HTML

7
 
1
<ul id='ul'>
2
  <li>
3
    <input type="tel" />
4
    <p>请输入正确的电话号码</p>
5
  </li>
6
</ul>
7
<span>添加</span>

CSS

x
 
1
* {
2
  margin: 0;
3
  padding: 0;
4
}
5
ul,
6
li {
7
  list-style: none;
8
}
9
10
ul {
11
  padding:10px 20px;
12
}
13
ul li{
14
margin-top:10px;
15
}
16
ul li input {
17
  padding: 0 10px;
18
  height: 30px;
19
  border: 1px solid #ddd;
20
}
21
22
ul li p {
23
  color: red;
24
  font-size: 12px;
25
  margin-top:5px;
26
  display: none;
27
}
28
29
span {
30
  display: block;
31
  margin-left: 20px;
32
  width: 60px;
33
  height: 28px;
34
  background: #00A2D4;
35
  text-align: center;
36
  line-height: 28px;
37
  color: #fff;
38
  font-size: 14px;
39
  cursor: pointer;
40
}
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

16
 
1
$(function(){
2
  $('#ul').on('keyup', 'input', function(){
3
    var v = $(this).val();
4
    if( ! /^1[34578]\d{9}/.test(v) ){
5
      $(this).next().show();
6
    }else{
7
      $(this).next().hide();
8
    }
9
  });
10
  $('span').click(function(){
11
    var li=$('#ul li:first').clone();
12
    $('input',li).val('');
13
    $('p', li).hide();
14
    $('#ul').append( li );
15
  });
16
});
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

  1. 暂无文件
拖动文件到上面的区域或者:
加载中 ..................