Toggle to view more text - Jquery

Hello, this is content1 class Hello, this is content2 class - slide toggle The long text the better Longer longerr <button id="viewmore">View more...</button> <style> div.content2{ background: #ccc; padding: 30px 0px; } </style> <pre data-lang="HTML"><code>&lt;div&gt;Hello, this is content1 class&lt;/div&gt; &lt;div&gt;Hello, this is content2 class - slide toggle&lt;br&gt; The long text the better&lt;br&gt;Longer&lt;br&gt;longerr&lt;/div&gt; &lt;button id="viewmore"&gt;View more...&lt;/button&gt; &lt;script&gt; $(document).ready(function(){ $("div.content2").hide(); $("button#viewmore").click(function(){ $("div.content2").slideToggle(); }); }); &lt;/script&gt;</code></pre>