<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. 4D数据介绍

    转自青椒炒蛋:http://www.smallleafs.com/article/35.aspx 4D数据包括DLG(数字线画地图).DEM(数字高程模型).DOM(数字正射影像地图).DRG(数字栅 ...

  2. truncate与delete 、drop的区别

    注意事项 1.在oracle中数据删除后还能回滚是因为它把原始数据放到了undo表空间. 2.DML语句使用undo表空间,DDL语句不使用undo,  而delete是DML语句,truncate是 ...

  3. Express 4.x Node.js的Web框架

    为了防止无良网站的爬虫抓取文章,特此标识,转载请注明文章出处.LaplaceDemon/SJQ. http://www.cnblogs.com/shijiaqi1066/p/3821150.html ...

  4. Mysql打开日志信息

    还可参考博客:http://pangge.blog.51cto.com/6013757/1319304 1)怎么查看mysql是否启用了日志 mysql>show variables like ...

  5. win8.1恢复win7 CTRL+Space切换输入法

    win8用起来还是有很多好用的东西的,但是最让我受不了的就是输入法的切换,可以说是丧心病狂!!!折磨了我好久,今天终于找到了解决的办法! 那就是这位博客园的哥们给出的方案! http://www.cn ...

  6. css3 边框记

    css3 边框 border属性在css1中就已经定义了,使用它可以设置元素的边框风格,边框颜色以及边框粗细. border-width:设置元素边框的粗细. border-color:设置元素边框的 ...

  7. AES加密和Base64混合加密

    /// <summary> /// AES加密方法(AES加密和Base64混合加密) /// </summary> /// <param name="toEn ...

  8. WCF Membership and Role Provider

    本文介绍的是如何使用Membership 和 Role Provider 来控制 WCF 调用方法的权限. 比如我们有一个WCF Method 叫 GetData(int num),然后我们只允许Ro ...

  9. jquery---helloworld

    style.css

  10. python学习day5--set、函数

    1.set 无序,不重复序列 创建:与dict一样用{},区别在于dict内元素为键值对 se={"123","456,444"} print(type(se) ...