小编use*_*953的帖子

如何在第二个位置限制零

在下面的代码中,文本框在起始位置限制为零.但我想在第一个位置只允许一个零但不超过一个.这是一个例子

例如: - 0.1012400 ==>正确

000.4545000 ==>不正确

0154 ==>正确

00154 ==>不正确

$('input#abc').keypress(function(e){ 
 if (this.selectionStart == 0 && (e.which == 48 || e.which == 46 )){
      return false;
   }
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="abc">
Run Code Online (Sandbox Code Playgroud)

html javascript jquery input

3
推荐指数
1
解决办法
360
查看次数

如何删除选中的单选按钮

小提琴.

这里我有一个表,在这个添加按钮就在那里,每次都会添加单选按钮,当我点击清除按钮时,应该取消选中所选的单选按钮.

$scope.Clear = function() {
  radiobtn = document.getElementById("theid");
  radiobtn.checked = false;  
};  
Run Code Online (Sandbox Code Playgroud)

html javascript jquery angularjs

1
推荐指数
1
解决办法
55
查看次数

标签 统计

html ×2

javascript ×2

jquery ×2

angularjs ×1

input ×1