zoukankan      html  css  js  c++  java
  • iFE-30 笔记

    //input背景被选中变色
    var input = document.getElementById('input');
       var btn = document.querySelectorAll('button')[0];
       btn.onclick= function(){
          input.style.backgroundColor = 'blue'
       }
    //input背景不变色(没被选中)
    var input = document.querySelectorAll('#input');
       var btn = document.querySelectorAll('button')[0];
       btn.onclick= function(){
          input.style.backgroundColor = 'blue'
    }
    //input背景变色
    var input = document.querySelectorAll('#input')[0];
       var btn = document.querySelectorAll('button')[0];
       btn.onclick= function(){
          input.style.backgroundColor = 'blue'
    }
    •  //确认密码
          function passwordConfirm() {
              var input = confirm.querySelectorAll('input')[0];
      //  var inputValue = confirm.querySelectorAll('input')[0].value;
      //inputValue为初始化密码栏的值,理清楚顺序!
              var span = confirm.querySelectorAll('span')[0];
              //var firstP = password.querySelectorAll('input')[0];
              var firstP = password.querySelectorAll('input')[0];
              //聚焦时
              input.onfocus = function () {
                  span.innerHTML = '请再次输入密码';
              }
              //离开输入框时
              input.onblur = function () {
                  var cPassword = input.value;
                  if(cPassword != ''){
                      if ( cPassword == firstP.value ) {
                          span.innerHTML = '密码一致';
                          change(span, input, true)
                      } else {
                          span.innerHTML = '两次密码不一样'
                          change(span, input, false)
                      }
                  }else{
                      span.innerHTML = '密码不能为空';
                      change(span, input, false)
                  }
              }
          }
  • 相关阅读:
    poj2181 jumping cow
    poj2184
    POJ 1189 钉子和小球
    uva11019矩阵匹配器D316
    noip2015运输计划
    [LintCode] Last Position of Target
    [LintCode] K Closest Points
    [LintCode] K Closest Numbers In Sorted Array
    [LintCode] Closest Number in Sorted Array
    [LintCode] Perfect Squares
  • 原文地址:https://www.cnblogs.com/huangxingyuan/p/IFE.html
Copyright © 2011-2022 走看看