Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

HTML Topics

HTML high Attribute

Posted in HTML Tutorial
Updated on Oct 29, 2024
By Mari Selvan
👁️ 51 - Views
⏳ 4 mins
💬 1 Comment
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:

high.html
Copied
Copy To Clipboard
<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:

high.html
Copied
Copy To Clipboard
<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:

high.html
Copied
Copy To Clipboard
<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:

To get interesting news and instant updates on Front-End, Back-End, CMS and other Frameworks. Please Join the Telegram Channel:

Author

author
👋 Hey, I'm Mari Selvan

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

Share Your Findings to All

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Mari Selvan
Mari Selvan
10 months ago

If you have any doubts regarding this article (HTML high Attribute), please comment here. I will help you immediately.

We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy
AgreeCookie Policy