Function to number paragraphs starting from a sibling
<pre><code>&lt;!-- html --&gt;
&lt;h1&gt;Title 1&lt;/h1&gt;
&lt;p&gt;paragraph 1&lt;/p&gt;
&lt;p&gt;paragraph 2&lt;/p&gt;
&lt;p&gt;paragraph 3&lt;/p&gt;
&lt;h1&gt;Title 2&lt;/h1&gt;
&lt;p&gt;paragraph 1&lt;/p&gt;
&lt;p&gt;paragraph 2&lt;/p&gt;
&lt;p&gt;paragraph 3&lt;/p&gt;

&lt;!--jQuery --&gt;
$('#numPara').bind('click', function(){
    var i=0;
    var bouton = $(this);
    $('p').nextUntil('h1').each(function(index, element){
        console.log(element);
        $(element).prepend((index+1) + '.' + (index+1) + " ");
        bouton.attr('disabled', false);
        });

    });
}); 
</code></pre>

<p>Question: How can I number the paragraphs from the number of the title? I already 'bind' my button to number the paragraphs but it doesn't apply on the first paragraph of each section and it doesn't follow the number of the title. Teacher told me that I should put limits but I've been searching for a few hours now and I have no idea how to do it. Thank you for any help.</p>

<pre><code>Example : 1. Title1
          1.1 paragraph1
          1.2 paragraph2
          1.3 paragraph3
          2. Title2
          2.1 paragraph1
          2.2 paragraph2
          2.3 paragraph3
</code></pre>
