//js锚点定位
//定位到第一个错误提示的地方
//定位到第一个验证提示的地方
//查找所有class为tip,且内容不为空的元素
//$(".tip").filter(function(){return $.trim($(this).text()) != ""}) 返回集合;
function toFirstTip(){
// alert($(".tip").filter(function(){return $.trim($(this).text()) != ""}).size());
if($(".tip").filter(function(){return $.trim($(this).text()) != ""}).size()>0){
var firstTip=$(".tip").filter(function(){return $.trim($(this).text()) != ""}).eq(0);
var firstTipId=firstTip.attr("id");
if( $.trim(firstTipId)==""){
firstTipId="firstTip";
$(".tip").filter(function(){return $.trim($(this).text()) != ""}).eq(0).attr("id",firstTipId);
}
$("#"+firstTipId).closest(".wrappedTables").css("display","block");
window.location.href="#"+firstTipId;
}
}
表单验证,定位到第一个错误提示的地方
原创mb64ba3e4bd95e5 博主文章分类:js ©著作权
文章标签 javascript 数据库 ViewUI 错误提示 css 文章分类 JavaScript 前端开发
-
278. 第一个错误的版本
2021-06-13 LeetCode每日一题链接:https://leetcode-cn.com/problems/first-bad-version/标签:二分查找题目你是产品经理,目前正在带领一个团队开发新的产品。不幸的是,你的产品的最新版本没有通过质量检测。由于每个版本都是基于之前的版本开发的,所以错误的版本之后的所有版本都是错的。假设你有 n 个版本 [1, 2, …, n],你想找出导致之后所有版本出错的第一个错误的版本。你可以通过调用 bool isBadVersion(ver
LeetCode每日一题 LeetCode leetcode 二分查找 经验分享