Computer >> Máy Tính >  >> Lập trình >> HTML

Thuộc tính cao HTML

Thuộc tính high trong HTML được sử dụng với một thước đo để chỉ định giá trị cao của thước đo đó. Sử dụng nó với các thuộc tính tối đa, tối thiểu, thấp của thước đo để có được kết quả tốt hơn.

Hãy để chúng tôi xem một ví dụ về Mét cao tài sản -

Ví dụ

<!DOCTYPE html>
<html>
<head>
<title>Meter high</title>
<style>
   form {
      width:70%;
      margin: 0 auto;
      text-align: center;
   }
   * {
      padding: 2px;
      margin:5px;
   }
   input[type="button"] {
      border-radius: 10px;
   }
</style>
</head>
<body>
<form>
<fieldset>
<legend>Meter-high</legend>
<label for="paulaLifeSource">Paula's Health Risk: </label>
<meter id="paulaLifeSource" max="100" min="0" high="80" low="70" value="85"></meter>
<input type="button" onclick="lifeSource()" value="Medi Kit">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
   var divDisplay = document.getElementById("divDisplay");
   divDisplay.textContent = 'Life Source at '+paulaLifeSource.value;
   function lifeSource(effect){
      var paulaLifeSource = document.getElementById("paulaLifeSource");
      var Immunity = paulaLifeSource.high;
      paulaLifeSource.high = 90;
      divDisplay.textContent = 'Immunity increased to '+paulaLifeSource.high+' from '+Immunity;
   }
</script>
</body>
</html>

Điều này sẽ tạo ra kết quả sau -

1) Trước khi nhấp vào ‘Bộ công cụ Medi’ nút -

Thuộc tính cao HTML

2) Sau khi nhấp vào ‘Medi Kit’ nút -

Thuộc tính cao HTML