<html>
<head>
<title>js页面</title>
<script src="js/old_boy.js"></script>
<style type="text/css">
.show{ }
.hide{
display:none;
}
.enter{
color:black;
}
.leave{
color:gray;
}
</style>
</head>
<body>
<div id="t1" class="show">内容</div>
<input type="button" id = "switch" onclick="hide();" value="隐藏"/> <form action="https://www.sogou.com/web?" id="form" method="GET">
<input type="text" name="query" />
<input type="button" value="伪提交" onclick="mySubmit();" />
</form><br/> <input type="text" name="leave" value="请输入内容" id="tip" onfocus="enter();" onBlur="leave();"/><br/><br/> <div style="border: 1px solid red;width:500px;height:90px" >
<div style="background-color:green;width:10%;height:100%" id="tipp"></div>
</div> <script type="text/javascript">
var div = document.getElementById("t1");
var button = document.getElementById("switch");
div.innerText += "追加内容"; function hide(){ var className = div.className;
if (className == "show"){
div.className = "hide";
button.setAttribute("value","显示"); } else {
div.className = "show";
button.setAttribute("value","隐藏");
}
console.log(div.className);
/*div.className="hide";
console.log(div.className);*/
}
function mySubmit(){
document.getElementById("form").submit();
} function enter(){
var tip = document.getElementById("tip");
if (tip.value == "请输入内容" || tip.value.trim() == ""){
tip.className = "enter";
tip.value = "";
} else {
tip.className = "enter";
}
} function leave(){
var tip = document.getElementById("tip");
if(tip.value.trim()==""){
tip.className = "leave";
tip.value = "请输入内容";
}
}
pro = 10; function progTipp(){
var prog= document.getElementById("tipp");
console.log(prog.style.width);
pro = pro + 10;
if (pro > 100){
clearInterval(interval);
} else { prog.style.width = pro +"%";
}
}
interval = setInterval("progTipp()",500); </script>
</body> </html>

  

python学习之js从0开始的更多相关文章

  1. python学习笔记--Django入门0 安装dangjo

    经过这几天的折腾,经历了Django的各种报错,翻译的内容虽然不错,但是与实际的版本有差别,会出现各种奇葩的错误.现在终于找到了解决方法:查看英文原版内容:http://djangobook.com/ ...

  2. Python学习之路--1.0 Python概述及基本数据类型

    Python是一门解释性语言,弱类型语言 python程序的两种编写方式: 1.进入cmd控制台,输入python进入编辑模式,即可直接编写python程序 2.在.朋友文件中编写python代码,通 ...

  3. 【Flask】 python学习第一章 - 6.0 WTF表单 数据库 蓝图

    WTF表单  wtf.py pip install flask-wtf  # 安装 from flask_wtf import FlaskForm from wtform import StringF ...

  4. 【Flask】 python学习第一章 - 2.0 视图方式和返回值

    路由参数与请求方式制定   ALT+回车 pycharm 快速导包  demo3  指定访问地址  与请求方式  #   给路由传入参数 使用尖括号 ,视图函数需要接收参数 @app.route(&q ...

  5. python学习之html从0开始(二)

    <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content ...

  6. 【Flask】 python学习第一章 - 5.0 模板

    jinjia2 模板 python实现 flask 内置语言  参照Djago实现  设置模板文件夹 设置模板语言 jinja2 demo6_template.html  ----> 从代码渲染 ...

  7. 【Flask】 python学习第一章 - 4.0 钩子函数和装饰器路由实现 session-cookie 请求上下文

    钩子函数和装饰器路由实现 before_request 每次请求都会触发 before_first_requrest  第一次请求前触发 after_request  请求后触发 并返回参数 tear ...

  8. 【Flask】 python学习第一章 - 3.0 正则转换和错误捕捉

    3.1正则转换器定义 Class RegexConverter(BaseConverter): regex = "[0-9]{6}" app.url_map.converters[ ...

  9. 【Flask+Redis】 python学习第一章 - 7.0 断言 数据库测试 redis学习

    assert 断言 def div(num1, num2): # 断言 assert isinstance(num1, int), "值类型错误" assert isinstanc ...

随机推荐

  1. 实例源码--Android简单音乐播放器源码

      下载源码   技术要点: 1.本地音乐管理 2.在线音乐听歌.下载 3.音频流的解码 4. HTTP通信模块 5. Sqlite数据库 6. 源码带详细的中文注释 ...... 详细介绍: 1.本 ...

  2. Java_Spring MVC_Servlet

    Spring MVC 例子 http://www.cnblogs.com/liukemng/p/3724379.html 详解: http://jinnianshilongnian.iteye.com ...

  3. hdu1051 Wooden Sticks

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=1051 大意:求最少升序序列的个数. #include <cstdio> #include &l ...

  4. POJ 2498 Martian Mining

    Martian Mining Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 2194   Accepted: 1326 De ...

  5. python邮件发送接收

    接收邮件 import poplib,pdb,email,re,time from email import header POP_ADDR = r'pop.126.com' USER = '' PA ...

  6. 获取地理位置的html5代码

    /** * 以下为html5代码,获取地理位置 */ function getLocation() { //检查浏览器是否支持地理位置获取 if (navigator.geolocation) { / ...

  7. Windows Azure 微软公有云体验(一) 网站、SQL数据库、虚拟机

    Windows Azure 微软公有云已经登陆中国有一段时间了,现在是处于试用阶段,Windows Azure的使用将会给管理信息系统的开发.运行.维护带来什么样的新体验呢? Windows Azur ...

  8. 《sift算法详解》阅读笔记

    原博客来自:http://blog.csdn.net/zddblog/article/details/7521424 定义: 尺度不变特征转化是一种计算机视觉算法,用于侦测和描述物体的局部性特征,在空 ...

  9. 改变linux shell前景色和背景色

    作者:马 岩(Furzoom) (http://www.cnblogs.com/furzoom/)版权声明:本文的版权归作者与博客园共同所有.转载时请在明显地方注明本文的详细链接,未经作者同意请不要删 ...

  10. win10 IIS10 HTTP 错误 404.2 - Not Found

    环境win10系统IIS10里边发布web应用程序的时候,出现 HTTP 错误 404.2 - Not Found 由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页 ...