<label for="lineHeight">مقدار ویژگی line-height : </label>
<input type="text" name="line-height" id="lineHeight" />
<button id="setLineHeight">اعمال</button>
<p id="text">
شرکت پیشگامان صفر و یک فرساد با هدف توسعه سامانه‌های هوشمند و تشکيل يک خانواده بزرگ نرم‌افزاری در حوزه وب، فعالیت‌های خود را در سال 1390 آغاز کرد
</p>
body{
  background:#ddd;
  direction:rtl;
  text-align:center;
}
#lineHeight{
  width:180px;
  line-height:25px;
  padding:0 5px;
  direction:ltr;
 box-shadow:0 0 1px #000;
}
#setLineHeight{
  border:none;
  outline:none;
  width:70px;
  height:30px;
  text-align:center;
  border-radius:5px;
  background:#08c59a;
  color:#fff;
  cursor:pointer;
  font-weight:bold;
  box-shadow:0 0 1px 1px #aaa;
}
p{
  width:400px;
  background:#2ab8bb;
  color:#fff;
  padding:10px;
  border-radius:5px;
  font-size:16px;
  margin:15px auto;
  text-align:right;
}
var elem=document.getElementById("text");

document.getElementById("setLineHeight").onclick=function(){
  var lineHeight=document.getElementById("lineHeight").value;
elem.style.lineHeight=lineHeight+"";
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.