JSFiddle - React, Tailwind, and code Playground
by gurvinder372
HTML
<script src="//code.jquery.com/jquery-2.2.1.min.js"></script>
<div class="string">
</div>
JavaScript
var $text = $('.string').text("http://www.text.com");
if ($text.text().indexOf('http://') != -1)
{
$text.text( $text.text().replace('http://','') );
}
else if ($text.text().indexOf('https://') != -1) {
$text.text( $text.text().replace('https://','') );
}