Created
June 4, 2019 21:53
-
-
Save JudeRosario/07e4e1dcdbb5e4faaf8d53906c4040bb to your computer and use it in GitHub Desktop.
Private jQuery W3 Tag fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
$.fn.renameTag = function(replaceWithTag){ | |
this.each(function(){ | |
var outerHtml = this.outerHTML; | |
var tagName = $(this).prop("tagName"); | |
var regexStart = new RegExp("^<"+tagName,"i"); | |
var regexEnd = new RegExp("</"+tagName+">$","i") | |
outerHtml = outerHtml.replace(regexStart,"<"+replaceWithTag) | |
outerHtml = outerHtml.replace(regexEnd,"</"+replaceWithTag+">"); | |
$(this).replaceWith(outerHtml); | |
}); | |
return this; | |
} | |
$('.accordian.fusion-accordian h4.panel-title').renameTag('strong'); | |
$('.accordian.fusion-accordian i.fa-fusion-box').renameTag('em'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment