🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Comments.js is a lightweight jQuery plugin which enables you to get the comments inside the HTML comment tag within your document.

Comment

Documentation

jQuery.comments

A jQuery plugin to retrieve the comments inside a html or jQuery element

Getting Started

Just import the plugin to your html and call the function.

$('#container').comments(); 

Prerequisites

You need to import jQuery before this plugin.

Examples

You can get all comments from a jquery object or from a jquery element like:

var comments = $('#container').comments(); 

But if you want the comments in a cleaner version. If not, the plugin returns the comments as seen.

var commentsParsed = jQuery($data).comments(true); 

This plugin works with single comments like:

<!-- this is da comment --> 

And for a multi line comments:

<!--  	this is 	a multine 	comment --> 

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details


You May Also Like