HTML Topics
- HTML Intro
- HTML Basic
- HTML Editors
- HTML CSS
- HTML Tags
- HTML Deprecated Tags
- HTML Events
- HTML Event Attributes
- HTML Global Attributes
- HTML Attributes
- abbr
- accept
- accept-charset
- accesskey
- action
- align
- alt
- archive
- as
- async
- autocapitalize
- autocomplete
- autofocus
- autoplay
- axis
- bgcolor
- border
- cellpadding
- cellspacing
- char
- charoff
- charset
- checked
- cite
- class
- classid
- codebase
- codetype
- color
- cols
- colspan
- compact
- content
- contenteditable
- controls
- coords
- crossorigin
- data
- data-*
- datetime
- declare
- default
- defer
- dir
- dirname
- disabled
- download
- draggable
- enctype
- enterkeyhint
- for
- form
- formaction
- formenctype
- formmethod
- formnovalidate
- formtarget
- frame
- frameborder
- frameset
- headers
- height
- hidden
- high
- href
- hreflang
- hspace
- http-equiv
- id
- inert
- inputmode
- ismap
- kind
- label
- lang
- list
- loop
- low
- max
- maxlength
- media
- method
- min
- multiple
- muted
- name
- novalidate
- onabort
- onafterprint
- onbeforeprint
- onbeforeunload
- onblur
- oncanplay
- oncanplaythrough
- onchange
- onclick
- oncontextmenu
- oncopy
- oncuechange
- oncut
- ondblclick
- ondrag
- ondragend
- ondragenter
- ondragleave
- ondragover
- ondragstart
- ondrop
- ondurationchange
- onemptied
- onended
- onerror
- onfocus
- onhashchange
- oninput
- oninvalid
- onkeydown
- onkeypress
- onkeyup
- onload
- onloadeddata
- onloadedmetadata
- onloadstart
- onmousedown
- onmousemove
- onmouseout
- onmouseover
- onmouseup
- onmousewheel
- onoffline
- ononline
- onpagehide
- onpageshow
- onpaste
- onpause
- onplay
- onplaying
- onpopstate
- onprogress
- onratechange
- onreset
- onresize
- onscroll
- onsearch
- onseeked
- onseeking
- onselect
- onstalled
- onstorage
- onsubmit
- onsuspend
- ontimeupdate
- ontoggle
- onunload
- onvolumechange
- onwaiting
- onwheel
- open
- optimum
- pattern
- placeholder
- popover
- popovertarget
- popovertargetaction
- poster
- preload
- readonly
- rel
- required
- reversed
- rows
- rowspan
- sandbox
- scope
- selected
- shape
- size
- sizes
- span
- spellcheck
- src
- srcdoc
- srclang
- srcset
- start
- step
- style
- tabindex
- target
- title
- translate
- type
- usemap
- value
- width
- wrap
- HTML Comments
- HTML Entity
- HTML Head
- HTML Form
- HTML IndexedDB
- HTML Drag & Drop
- HTML Geolocation
- HTML Canvas
- HTML Status Code
- HTML Language Code
- HTML Country Code
- HTML Charset
- MIME Types
HTML high Attribute
Photo Credit to CodeToFun
🙋 Introduction
The high
attribute in HTML is a feature used in conjunction with the <meter> element.
It allows developers to set the highest value of the range for the <meter> element, providing additional context and information about the measured quantity.
🎯 Purpose of high
The primary purpose of the high
attribute is to define the upper limit of the range represented by the <meter> element.
This upper limit serves as a reference point, helping users understand the significance of the measured value in relation to the maximum possible value.
💎 Values
The high
attribute accepts numerical values to specify the upper limit of the range.
This value is often used to represent the maximum expected or allowed value for the measured quantity. For example:
<meter value="75" min="0" max="100" high="90">75%</meter>
🧠 How it Works
In this example, the high
attribute is set to "90," indicating that a value of 75% is approaching the upper limit of the acceptable range.
📄 Example
Here's a simple example demonstrating the use of the high
attribute in conjunction with the <meter> element:
<meter value="120" min="0" max="200" high="180">120 units</meter>
🧠 How it Works
In this case, the high
attribute is set to 180, indicating that 120 units is approaching the upper limit of the acceptable range, which is 200 units.
🔄 Dynamic Values with JavaScript
Similar to other HTML attributes, you can dynamically set the high
attribute using JavaScript.
This is useful when you want to adjust the upper limit based on user interactions or changing conditions. Here's a brief example:
<script>
// Dynamically set the high attribute for a meter element
document.getElementById("dynamicMeter").high = 250;
</script>
<meter id="dynamicMeter" value="200" min="0" max="300">200 units</meter>
🧠 How it Works
In this script, the high
attribute for a <meter> element with the id "dynamicMeter" is dynamically set to 250.
This can be beneficial when you need to update the upper limit dynamically based on data changes or user input.
🏆 Best Practices
- Use the
high
attribute to provide users with a clear understanding of the upper limit of the measured quantity. - Ensure that the high value is meaningful in the context of the data being represented by the <meter> element.
- Experiment with dynamic updates using JavaScript to enhance the interactivity of your web pages.
🎉 Conclusion
The high
attribute is a valuable tool when working with the <meter> element in HTML.
By incorporating the high
attribute, you can provide users with additional context about the upper limit of the measured quantity, enhancing the overall clarity of your web content.
👨💻 Join our Community:
Author
For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.
Buy me a coffee to make codetofun.com free for everyone.
Buy me a Coffee
If you have any doubts regarding this article (HTML high Attribute), please comment here. I will help you immediately.