javascript - Using jquery to edit css attribute of a text without selector -
i trying apply smiley(emoji) users comments on page. example :) applied css attributes replaced with. there way can use javascript or jquery achieve this?
$(":)").css("background-image", "url('smile.gif')");
my problem selector part, since dont want apply css whole div.
you need wrp html text ':)' html , can add css/jq it. see below javascript code , try add css "smiley" class
document.body.innerhtml = document.body.innerhtml.replace(':)', '');
Comments
Post a Comment