带按钮的Html输入 [英] Html input with button

查看:154
本文介绍了带按钮的Html输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!--html way-->
   <input type="button" onclick="alert('Hello World')" value="Click Me">

   <!--javascript way-->
   <button type="button" onclick="alert('Hello World')">Click Me</button>





我的尝试:



i混淆学习HTML按钮。他们的工作方式相同。

我可以这样说,就像在我的评论中或有什么区别?谢谢!



What I have tried:

i am confused learning the HTML button.they work the same.
can i say that like in my comment or what is the difference? thank you!

推荐答案

区别在于一个是HTML而另一个是Javscript。请参阅 W3Schools在线Web教程 [ ^ ]了解更多详情。
The difference is that one is HTML and the other is Javscript. See W3Schools Online Web Tutorials[^] for more details.


Html输入控件没有内部Html标签。

但在按钮控制中你可以添加内部Html标签。



< input type =buttonvalue =Hello/>

< br />

< button>< b style =color:red;> Hello< / b>< / button>



Exa。
Html Input Control Doesn't Have Inner Html Tags.
But In Button Control U Can Add Inner Html Tags.

"<input type="button" value="Hello"/>
<br/>
<button><b style="color:red;">Hello</b></button>"

Exa.
<input type="button" value="Hello"/>
<br/>
<button>Hello</button>


这篇关于带按钮的Html输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆