The <button> tag is used to create clickable buttons in HTML. It can display text or images and trigger different actions like submitting a form or refreshing content when clicked. Buttons have optional and standard attributes that control behaviors like disabling the button, setting the button type, and triggering scripts on events like clicks or mouseovers. Code examples demonstrate basic, disabled, submit, and multiple choice buttons.
2. HTML <button> tag
• Used to create a clickable button
• Can display text or images in newer web
browsers
3. Functions
• Displays new content when pressed
• Can be used as a standard button, a
reset/refresh button, or a “submit” button
• Many different attributes
4. Attributes
• Optional
• Disabled – Disables the function of the button
• Type – Can change function from button to reset or
submit
5. Attributes
• Standard
– Lang – Set the language code for the content
– Dir – Choose the direction of the text
• ex: ltr or rtl
6. Attributes
• Event
– Onmouseup – set to run when mouse button is
released
– Onmouseover – set to run script on when pointer
moves over the element
– Onclick – set script to run on mouse click