Replace string using jquery
<p>How can I replace 'http://' or 'https://' from a text added with javascript?</p>

<p>I am also interested in regex solutions.</p>

<p>Here is what I made so far:</p>

<p><a href="https://jsfiddle.net/wLrjtjt3/3/" rel="nofollow">JSFIDDLE</a></p>

<p>HTML:</p>

<pre><code>&lt;div class="string"&gt;&lt;/div&gt;
</code></pre>

<p>JS:</p>

<pre><code>$text = $('.string').text("http://www.text.com");

if ($text.startsWith('http://')) {
    $text.replace('http://','');
}
else if ($text.startsWith('https://')) {
    $text.replace('https://','');
}
</code></pre>