JSFiddle - React, Tailwind, and code Playground

by 규연 황

HTML

<ul>
  <li>가나다라</li>
  <li>가나다라가나다라가나다라가나다라</li>
</ul>

CSS

ul {
  width:100px;
  
}
li {
  width: 50%;
  float: left;
  background-color: #eee;
  box-sizing: border-box;
}

JavaScript

var li1 = document.querySelector('li:nth-child(1)');
var li2 = document.querySelector('li:nth-child(2)');
/* console.log(typeof li1); */
console.log(typeof li2.clientHeight);

if(li1.clientHeight > li2.clientHeight){
	li2.style.height = li1.clientHeight + "px";
} else {
	li1.style.height = li2.clientHeight + "px";
}