JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<input type="button" class="button" value="留言">
<div class="text active">
<textarea name="area" cols="30" rows="10"></textarea>
<input type="submit" value="send it">
</div>
</body>
</html>
CSS
.text{
opacity: 0;
transition: all 3s;
}
.text.active{
opacity:1;
}
JavaScript
$(document).ready(function () {
$('.button').click(function () {
$('.text').toggleClass('active');
});
});