Auto Wrap ® In HTML sup Tag - jQuery sup-reg.js

File Size: 5.2 KB
Views Total: 620
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Auto Wrap ® In HTML sup Tag - jQuery sup-reg.js

sup-reg.js is a dead simple jQuery plugin that automatically wraps registered trademark sign (®) around HTML <sup> tag with a given CSS class.

Install & Download

# NPM
$ npm install sup-reg --save

# Bower
$ bower install sup-reg --save

How to use it:

1. Download and import the sup-reg.js script after jQuery.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<script src="sup-reg.js"></script>

2. This will wrap all the trade marks around HTML <sup> tags with the CSS class of sup-reg. So that you can style the trade marks whatever you like in the CSS.

<!-- Convert -->
<p>jQueryScript ®</p>
<!-- Into -->
<p>jQueryScript <sup class="sup-reg">®</sup></p>

3. Style the trade marks whatever you like.

.sup-reg {
  color: red;
  font-size: 10px;
  /*
    more styles here
  */
}

This awesome jQuery plugin is developed by megasmack. For more Advanced Usages, please check the demo page or visit the official website.