{"id":18432,"date":"2017-09-04T16:15:10","date_gmt":"2017-09-04T13:15:10","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=18432"},"modified":"2018-01-08T13:01:52","modified_gmt":"2018-01-08T11:01:52","slug":"bootstrap-expand-collapse-text-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/","title":{"rendered":"Bootstrap Expand Collapse Text Example"},"content":{"rendered":"<p>In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we initially just want to show a teaser or heading and allow the user to decide whether to show the entire content. You must have seen such feature on news sites, wherein, just the headline and a teaser summary of the article is visible and in case it interests you there is a &#8220;More&#8230;&#8221; link at the bottom of the teaser.<\/p>\n<p>In the example we will display a couple of collapsible texts where we will show a teaser with a link to &#8220;Toggle Content&#8221; and &#8220;More&#8230;&#8221; and once the entire content is visible we will show a &#8220;Less&#8230;&#8221; link to collapse the content again. We will use the Bootstrap class <code>collapse<\/code> to implement this feature. We will look at two approaches to it, one using just markup and the other involving some JavaScript code.<br \/>\n[ulp id=&#8217;57DHuNTHJ2qczaGz&#8217;]<br \/>\n&nbsp;<\/p>\n<h2>1. Tools &amp; Technologies<\/h2>\n<p>We use the following tools &amp; technologies to implement this example:<\/p>\n<ol>\n<li><a href=\"http:\/\/getbootstrap.com\/getting-started\/#download\" target=\"_blank\" rel=\"noopener\">Bootstrap v3.3.7<\/a><\/li>\n<li><a href=\"https:\/\/blog.jquery.com\/2016\/05\/20\/jquery-1-12-4-and-2-2-4-released\/\" target=\"_blank\" rel=\"noopener\">JQuery v1.12.4<\/a><\/li>\n<li><a href=\"https:\/\/nodejs.org\/en\/download\/\" target=\"_blank\" rel=\"noopener\">Nodejs v6.3.0<\/a><\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/express\" target=\"_blank\" rel=\"noopener\">Express<\/a><\/li>\n<li><a href=\"https:\/\/code.visualstudio.com\/download\" target=\"_blank\" rel=\"noopener\">Visual Studio Code IDE<\/a><\/li>\n<\/ol>\n<h2>2. Project Structure<\/h2>\n<p>We start off building our example project with the following project structure. Although I have used Visual Studio Code IDE, any text editor of your choice would suffice for the purpose.<\/p>\n<figure id=\"attachment_18444\" aria-describedby=\"caption-attachment-18444\" style=\"width: 357px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/BootstrapExpandCollapseProjectLayout.jpg\"><img decoding=\"async\" class=\"size-full wp-image-18444\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/BootstrapExpandCollapseProjectLayout.jpg\" alt=\"\" width=\"357\" height=\"462\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/BootstrapExpandCollapseProjectLayout.jpg 357w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/BootstrapExpandCollapseProjectLayout-232x300.jpg 232w\" sizes=\"(max-width: 357px) 100vw, 357px\" \/><\/a><figcaption id=\"caption-attachment-18444\" class=\"wp-caption-text\">Project Layout<\/figcaption><\/figure>\n<p><strong><em>css<\/em><\/strong><br \/>\nThese css files from Bootstrap package reside in this folder. All the css stylesheets created by us would reside here as well.<br \/>\n<strong><em>fonts<\/em><\/strong><br \/>\nAll the font files that came with Bootstrap are located in this folder.<br \/>\n<strong><em>js<\/em><\/strong><br \/>\nThe Bootstrap JavaScript files are placed here along with the file we will create, namely, bootstrap.expand.collapse.js<br \/>\n<strong><em>index.html<\/em><\/strong><br \/>\nThe file is based on the template at\u00a0<a href=\"https:\/\/getbootstrap.com\/docs\/3.3\/getting-started\/#template\" target=\"_blank\" rel=\"noopener\">Bootstrap Getting Started<\/a> section. It holds the HTML markup and is our landing page. All the other files are referenced in this one and they come together in the browser and make things happen.<br \/>\n<strong><em>index.js<\/em><\/strong><br \/>\nOur barebones web server is built using Node.js and Express module resides in this file.<\/p>\n<h2>3. Using the collapse Bootstrap Class<\/h2>\n<p>To begin with,\u00a0 we add a <code>p<\/code> tag with the text &#8220;This is an example of Bootstrap Collapse CSS Class&#8221;. Next we add an <code>a<\/code> tag with <code>href=\"#content1\"<\/code> and <code>data-toggle=\"collapse\"<\/code> attributes followed by some &#8220;Lorem Ipsum&#8221; text wrapped in a <code>div<\/code> tag with <code>id=\"content\"<\/code> and <code>class=\"collapse\"<\/code> attributes within the <code>p<\/code> tag. So, the Html added so far looks like below:<\/p>\n<pre class=\"brush:html;\">&lt;p&gt;\r\n    This is an example of Bootstrap Collapse CSS Class\r\n    &lt;a href=\"#content1\" data-toggle=\"collapse\"&gt;Toggle Content...&lt;\/a&gt;\r\n    &lt;div id=\"content1\" class=\"collapse\"&gt;\r\n        Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;br\/&gt;\r\n        Quid ergo hoc loco intellegit honestum? Eaedem res maneant alio modo.&lt;br\/&gt;\r\n        Cur id non ita fit? Odium autem et invidiam facile vitabis.&lt;br\/&gt;\r\n        Aliud igitur esse censet gaudere, aliud non dolere.&lt;br\/&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/p&gt;\r\n<\/pre>\n<p>Next, we will move on to implement the same feature with some JavaScript.<\/p>\n<h2>4. Using a bit of JavaScript<\/h2>\n<p>We add the following Html Markup for this and it looks like below:<\/p>\n<pre class=\"brush:html;\">&lt;p&gt;\r\n    This is an example of Bootstrap Collapse CSS Class with a bit of JavaScript\r\n    &lt;a id=\"trigger\" href=\"#content2\" data-toggle=\"collapse\"&gt;More...&lt;\/a&gt;\r\n    &lt;div id=\"content2\" class=\"collapse\"&gt;\r\n        Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;br\/&gt;\r\n        Quid ergo hoc loco intellegit honestum? Eaedem res maneant alio modo.&lt;br\/&gt;\r\n        Cur id non ita fit? Odium autem et invidiam facile vitabis.&lt;br\/&gt;\r\n        Aliud igitur esse censet gaudere, aliud non dolere.&lt;br\/&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/p&gt;\r\n<\/pre>\n<p>Now, we add a JavaScript file named <code>bootstrap.expand.collapse.js<\/code> under the <code>js<\/code> folder. In this file we declare a variable which acts as a flag indicating whether the text is collapsed or expanded. Next we add an event handler to change the text of the <code>a<\/code> tag from &#8220;More&#8230;&#8221; to &#8220;Less&#8230;&#8221; or vice versa based on the flag&#8217;s value. The JavaScript should look like:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>bootstrap.expand.collapse.js<\/em><\/span><\/p>\n<pre class=\"brush:js;\">var trigger = document.getElementById(\"trigger\");\r\nvar expanded = false;\r\n\r\ntrigger.addEventListener(\"click\", function(){\r\n    expanded = !expanded;\r\n    if(expanded){\r\n        trigger.innerHTML = \"Less...\";\r\n    } else {\r\n        trigger.innerHTML = \"More...\";\r\n    }\r\n    \r\n});\r\n<\/pre>\n<p>To see the results of what we have implemented so far, I will show you how to run this code in the next section.<\/p>\n<h2>5. Run the Code<\/h2>\n<p>To run the application, we need to run the following two commands at the root of the project.<\/p>\n<pre class=\"brush: bash;\">&gt; npm install\r\n<\/pre>\n<pre class=\"brush: bash;\">&gt; node index.js\r\n<\/pre>\n<p>Now, in a browser we navigate to <code>http:\/\/localhost:8090<\/code> to see the following results:<\/p>\n<figure id=\"attachment_18451\" aria-describedby=\"caption-attachment-18451\" style=\"width: 806px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/CollapsedText.jpg\"><img decoding=\"async\" class=\"size-full wp-image-18451\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/CollapsedText.jpg\" alt=\"\" width=\"806\" height=\"415\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/CollapsedText.jpg 806w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/CollapsedText-300x154.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/CollapsedText-768x395.jpg 768w\" sizes=\"(max-width: 806px) 100vw, 806px\" \/><\/a><figcaption id=\"caption-attachment-18451\" class=\"wp-caption-text\">Collapsed Text<\/figcaption><\/figure>\n<figure id=\"attachment_18452\" aria-describedby=\"caption-attachment-18452\" style=\"width: 804px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/ExpandedText.jpg\"><img decoding=\"async\" class=\"size-full wp-image-18452\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/ExpandedText.jpg\" alt=\"\" width=\"804\" height=\"510\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/ExpandedText.jpg 804w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/ExpandedText-300x190.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/ExpandedText-768x487.jpg 768w\" sizes=\"(max-width: 804px) 100vw, 804px\" \/><\/a><figcaption id=\"caption-attachment-18452\" class=\"wp-caption-text\">Expanded Text<\/figcaption><\/figure>\n<h2>6. Download the Source Code<\/h2>\n<p>This was an example of Expand Collapse text using Bootstrap.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here : <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/WCG-Bootstrap-Expand-Collapse-Text-Example.zip\"><strong>Bootstrap Expand Collapse Text Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we initially just want to show a teaser or heading and allow the user to decide whether to show the entire content. You must have seen such feature on news sites, &hellip;<\/p>\n","protected":false},"author":213,"featured_media":8515,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[284],"tags":[],"class_list":["post-18432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bootstrap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bootstrap Expand Collapse Text Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bootstrap Expand Collapse Text Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-04T13:15:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-08T11:01:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Seth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Seth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\"},\"author\":{\"name\":\"Siddharth Seth\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592\"},\"headline\":\"Bootstrap Expand Collapse Text Example\",\"datePublished\":\"2017-09-04T13:15:10+00:00\",\"dateModified\":\"2018-01-08T11:01:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\"},\"wordCount\":612,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg\",\"articleSection\":[\"Bootstrap\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\",\"name\":\"Bootstrap Expand Collapse Text Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg\",\"datePublished\":\"2017-09-04T13:15:10+00:00\",\"dateModified\":\"2018-01-08T11:01:52+00:00\",\"description\":\"In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/css\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bootstrap\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/css\/bootstrap\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Bootstrap Expand Collapse Text Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592\",\"name\":\"Siddharth Seth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"caption\":\"Siddharth Seth\"},\"description\":\"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.\",\"sameAs\":[\"https:\/\/www.webcodegeeks.com\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/siddharth-seth\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bootstrap Expand Collapse Text Example - Web Code Geeks - 2026","description":"In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/","og_locale":"en_US","og_type":"article","og_title":"Bootstrap Expand Collapse Text Example - Web Code Geeks - 2026","og_description":"In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we","og_url":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-09-04T13:15:10+00:00","article_modified_time":"2018-01-08T11:01:52+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg","type":"image\/jpeg"}],"author":"Siddharth Seth","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Siddharth Seth","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/"},"author":{"name":"Siddharth Seth","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592"},"headline":"Bootstrap Expand Collapse Text Example","datePublished":"2017-09-04T13:15:10+00:00","dateModified":"2018-01-08T11:01:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/"},"wordCount":612,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg","articleSection":["Bootstrap"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/","url":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/","name":"Bootstrap Expand Collapse Text Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg","datePublished":"2017-09-04T13:15:10+00:00","dateModified":"2018-01-08T11:01:52+00:00","description":"In this example we will take a look at implementing an Expand Collapse Text feature using Bootstrap Framework. Sometimes our content is large and we","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/11\/bootstrap-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-expand-collapse-text-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/www.webcodegeeks.com\/category\/css\/"},{"@type":"ListItem","position":3,"name":"Bootstrap","item":"https:\/\/www.webcodegeeks.com\/category\/css\/bootstrap\/"},{"@type":"ListItem","position":4,"name":"Bootstrap Expand Collapse Text Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592","name":"Siddharth Seth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","caption":"Siddharth Seth"},"description":"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.","sameAs":["https:\/\/www.webcodegeeks.com"],"url":"https:\/\/www.webcodegeeks.com\/author\/siddharth-seth\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/213"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=18432"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18432\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/8515"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=18432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=18432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=18432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}