91-9990449935 0120-4256464 |
HTML Button TagThe <button> tag is used to create a clickable button within HTML form on your webpage. You can put content like text or image within the <button>........</button> tag. You should always specify the type attribute for a <button> tag. Different browsers use different default type for the button element. HTML Button tag can be used inside and outside the form. If you use it inside the form, it works as the submit button. You can also use it as reset button. If you use it outside the form, you can call JavaScript function on it. HTML Button Tag ExampleLet's see the code to display the button. Test it NowOutput: HTML Button Example: Calling JavaScript FunctionLet's see the code to call JavaScript function on button click. Test it NowOutput: HTML Button Example: Submit FormLet's see the code to submit form on button click. Test it NowOutput: HTML Button Example: Reset FormLet's see the code to submit form on button click. Test it NowOutput: Attributes of HTML Button Tag<button> tag supports all global attributes and some specific additional attributes. There is given a list of HTML button tag attributes.
Supporting Browsers
HTML button tag also supports the global and event attributes in HTML.
Next TopicHTML HR Tag
|