JSFiddle - React, Tailwind, and code Playground

by Julien Vernet

HTML

<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="//code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
<article class="content-left">
    <ol class="procedure-summary"></ol>
    	<h2>What is Breast Augmentation in Bangkok?</h2>

    <p>Breast Augmentation, otherwise known as Breast Enlargement, Breast Implantation or as a Boob Job, is by the far the most common form of plastic surgery requested by women. Many women feel unhappy about the shape and size of their breasts, and Breast Augmentation is a surgical procedure that uses artificial implants to increase the size, symmetry and lift of the breasts.</p>
    <p>TRIA Destination Beauty are breast augmentation experts in Bangkok, and our team of plastic surgeons havecarried out this procedure many thousand times before. This ensures that you have all the best conditions for a good outcome. Remember, our plastic surgeons do the breast augmentation surgery, but you do the healing, so please ensure you follow all the surgeons guidelines both pre- and post surgery. Especially the post surgery massage isimportant and you should pay special attention to that to ensure a good result.</p>
    
<h2>How is the Breast Augmentation Surgery Performed?</h2>

    <p>Breast Augmentation Surgery, which is carried out under general anesthetic, is a relatively straightforward procedure and generally takes around 1-2 hours to complete. It’s common for the patient to spend only 1 night in hospital, though every person and situation is different.</p>
    <p>There are a variety of techniques available depending on the surgeon’spreference as well as your preference and your body. They include:</p>
    <ol>
        <li><strong>Under the Breast</strong> Using this technique, the surgeon creates an incision under the breast fold and slidesthe implant up into the breast. This technique minimizes scarringas well,...

CSS

/* Demo purpose only */
.ui-page {
    padding: 30px;
    max-width: 480px;
}

JavaScript

// Transform content to be collapsible
$('article h2').each(function () {
    $(this).nextUntil("h2").andSelf().wrapAll('<div data-role="collapsible" />');
    $(this).nextUntil("h2").wrapAll('<div data-controltype="textblock" />');
});

// Credits to: http://stackoverflow.com/a/7968463/1414881

// Wrap everything and remove empty elements (unused)
$('article').wrapInner('<div id="test" data-role="collapsible-set">');
$('article').find('*:empty').remove();

// Attempt to refresh style
$('#test').trigger("create");