function findstartswith(inputlist, inputstring) { for (var il = 0; il < inputlist.length; il++) { if (inputlist[il].startsWith(inputstring)) { return il; } } } jQuery(document).ready(function ($) { /** progress bar */ $('.progress .progress-bar').each(function () { var text = jQuery(this).attr('class'), ca = text.split(' '); index = findstartswith(ca, "progress-percent"); a = ca[index].replace('progress-percent-', ''); $(this).css("width", a + '%'); var content = $(this).html(); $(this).html(content + "" + a + "% "); }); /** youtube popup */ jQuery('.box-shadow-ripples, .youtube-popup-link').click(function () { var link = jQuery(this).find('a').attr('href'); var iframeHtml = "