Note that there are some explanatory texts on larger screens.

plurals
  1. POFind and replace specific text with new div element containing that text in jQuery
    text
    copied!<p>I've got products description as text, which I can wrap into any container, but that's all what shop's template allows me to do:</p> <pre><code>&lt;div class="descriptionContainer"&gt; Some text description, some text description. Some text description, some text description. Some text description, some text description. Width: 80, Depth: 39, Height: 190 &lt;/div&gt; </code></pre> <p>How can I use jQuery to <strong>replace</strong> dimensions string into:</p> <pre><code>&lt;div class="productsDimensions"&gt; &lt;div class="row"&gt; &lt;span class="name"&gt;Width&lt;/span&gt; &lt;span class="value"&gt;80&lt;/span&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;span class="name"&gt;Depth&lt;/span&gt; &lt;span class="value"&gt;39&lt;/span&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;span class="name"&gt;Height&lt;/span&gt; &lt;span class="value"&gt;190&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I have to do this automatically, because e-shop application osCommerce that I'm using doesn't come with feature that allows specifying more product info than name, price and description.</p> <p>Thanks for any tips!</p> <h2>EDITED:</h2> <p>Sorry but I have to be more specific to not mislead you.</p> <p>What I got from shop template is:</p> <pre><code>&lt;div class="descriptionContainer"&gt; Some text description, some text description. Some text description, some text description. Some text description, some text description. Width: 80, Depth: 39, Height: 190 &lt;/div&gt; </code></pre> <p>So I have to find the Width, Depth, Height values first.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload