https://codepen.io/legendaryPower/pen/dvJQvB
$(document).ready(function() { $("#toggle").click(function() { var elem = $("#toggle").text(); if (elem == "Read More") { //Stuff to do when btn is in the read more state $("#toggle").text("Read Less"); $("#text").slideDown(); } else { //Stuff to do when btn is in the read less state $("#toggle").text("Read More"); $("#text").slideUp(); } }); });
@import url('https://fonts.googleapis.com/css?family=Raleway'); #text{ display:none; } .btn-container{ margin: auto; height:44px; width:166.23px; } a:active{ color:#ffd323; } body{ background-color:aqua; } button{ user-select:none; -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; cursor:pointer; border:none; padding:8px; font-size:20px; background:linear-gradient(141deg, #0fb8ad 0%, #1fc8db 51%, #2cb5e8 75%); color:white; font-family:cursive; box-sizing:border-box; } body{ font-family:'Raleway',monospace; font-size:20px; color:white; }
<h1 align="center">What is CSS?</h1> Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language.Although most often used to ...user interfaces for web applications, and user interfaces for many mobile applications. <div><span id="text">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="btn-container"><button id="toggle">Read More</button></div>