如果<button>标签在<form>中不加type=“button”,那么默认含义是“submit”。

<button>标签里面disabled属性使其不可用,常见javascript修改disabled属性实例:(a键b键互相撕逼)

<style>
#a,#b
{
height:30px;
width:70px;
background:yellow;
box-sizing:border-box;
} </style>
</head>
<body>
<button type="button" id="a" onclick="an()" >会变色</button>
<button type="button" id="b" onclick="bn()" >会变色</button>
<script> function bn()
{ if(document.getElementById("b").disabled!="true") {
document.getElementById("b").disabled="true";
document.getElementById("b").style.background="gray";
document.getElementById("a").removeAttribute("disabled");
document.getElementById("a").removeAttribute("style");
}
else
{
document.getElementById("a").disabled="true";
document.getElementById("a").style.background="gray";
document.getElementById("b").removeAttribute("disabled");
document.getElementById("b").removeAttribute("style");
} }
function an() { if(document.getElementById("a").disabled!="true")
{
document.getElementById("a").disabled="true";
document.getElementById("a").style.background="gray";
document.getElementById("b").removeAttribute("disabled");
document.getElementById("b").removeAttribute("style");
}
else
{
document.getElementById("b").disabled="true";
document.getElementById("b").style.background="gray";
document.getElementById("a").removeAttribute("disabled");
document.getElementById("a").removeAttribute("style");
}
}
</script>
</body>

  

HTML <button>标签的更多相关文章

  1. HTML <del> 标签

    HTML <del> 标签 什么是<del> 标签? 定义文档中已被删除的文本. 实例 a month  is <del>25</del> 30 day ...

  2. HTML——b i del a p img h1 h2 h3 h4 h5 h6 hr ol ul 标签的使用方法详解

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. 来吧,HTML5之基础标签(上)

    什么是html5 HTML 5 是下一代的 HTML.HTML5 仍处于完善之中.然而,大部分现代浏览器已经具备了某些 HTML5 支持. 学习过程中标签的理解 <a>标签  定义超链接, ...

  4. Html标签的语义化

    为了使我们的网站更好的被搜索引擎抓取收录,更自然的获得更高的流量,网站标签的语义化就显得尤为重要.所谓标签语义化,就是指标签的含义. 为了更好的理解标签的语义化,先看下面这个例子: 1 <tab ...

  5. HTML 文本格式化<b><big><em><i><small><strong><sub><sup><ins><del>

    <b> 标签-粗体 定义和用法: <b>标签规定粗体文本. 提示和注释 注释:根据 HTML5 规范,在没有其他合适标签更合适时,才应该把 <b> 标签作为最后的选 ...

  6. html5标签集结1

    1.<bdo>标签:覆盖默认的文本方向. <bdo dir="ltr">Here is some text</bdo>  显示结果(从左到右): ...

  7. HTML标签语义化

    标签语义化 Web语义化是指使用语义恰当的标签,使页面有良好的结构,页面元素有含义,能够让人和搜索引擎都容易理解. 如果可以在合适的位置使用恰当的标签,那么写出来的页面语义明确,结构清晰,搜索引擎也可 ...

  8. <jsp:include page="">和<%@include page=""%> 标签学习

    <jsp:include page=""><jsp:param value=""name=""/><DEL&g ...

  9. 前端基础HTML以及常用的标签

    cs模式:--- c:client  server bs模式:---Browser server 1.WEB标准的概念及组成 网页主要有三部分组成: a:结构   --  主要标准:XHTML和XML ...

  10. HTML标签参考(一)

    hi,小哥哥小姐姐们,我们今天要说的是前端的入门,却也是十分重要的意识的培养哦! • html中的标签数量是很多的,据人统计大概有300个左右,并且每年都会以20-30个的速度增加着,但是这么多的标签 ...

随机推荐

  1. QC邮件转发工具Mail Direct安装配置手册

    QC邮件转发工具Mail Direct安装配置手册 2010-06-11 10:00:56| 分类: 软件测试 | 标签: |举报 |字号大中小 订阅 QC邮件转发工具安装配置手册 由于公司没有独立的 ...

  2. 基于AngularJS的前端云组件最佳实践

    AngularJS是google设计和开发的一套前端开发框架,他能帮助开发人员更便捷地进行前端开发.AngularJS是为了克服HTML在构建应用上的不足而设计的,它非常全面且简单易学习,因此Angu ...

  3. WCF、Web API、WCF REST、Web Service

    WCF.Web API.WCF REST.Web Service 区别 Web Service It is based on SOAP and return data in XML form. It ...

  4. GLFW3出error adding symbols: DSO missing from command line解决

    背景:使用OpenGL的GLFW3.1库的时候,使用其中一些代码 报error adding symbols: DSO missing from command line 因为使用的是Qcreator ...

  5. Express安装入门与模版引擎ejs

    Express安装入门与模版引擎ejs 目录 前言 Express简介和安装 运行第一个基于express框架的Web 模版引擎 ejs express项目结构 express项目分析 app.set ...

  6. C#控件怎样获取,和失去焦点的处理

    publicForm1() { InitializeComponent(); textBox1.Enter+=newEventHandler(textBox1_Enter);//获得焦点事件 text ...

  7. Xcode中如何集成Unity

    项目中需要集成unity,摸索了大半周,碰到了很多坑,终于搞定. 我的方法是,通过unity导出一个空的iOS项目,然后再新建一个Xcode项目,针对配置页面一一对应.直到配置完全一样,然后倒入相关资 ...

  8. 【xcode插件介绍】Alcatraz ----The package manager for Xcode

    对于许多iOS开发者而言,Alcatraz并不陌生,甚至是相当的喜闻乐见.Alcatraz是一款开源的Xcode包管理器,由Marin Usalj.Delisa Mason和Jurre Stender ...

  9. 关于模板pair的用法

    在挑战程序设计竞赛中看到调用pair,就上网查了一下 类型申明有两种 template <class T1, class T2> struct pair typedef pairt< ...

  10. Leetcode::Pathsum & Pathsum II

    Pathsum Description: Given a binary tree and a sum, determine if the tree has a root-to-leaf path su ...