Convert jQuery to JS

Job ID: 31801645

Budget: $10 – $30 USD

I need to convert a star rating script which uses jQuery and PHP. I am making some changes on one of my website, jQuery will be removed and no other JS library/framework will be used. I need to convert jQuery part of the star rating script to work as vanilla Javascript. All endpoints/URLs, HTML, CSS class names, comments and variable names (wherever possible) should remain unmodified. The main thing is to convert the jQuery functions/logic to Vanilla JS.

Some hints:

1. Serverside PHP part is OK, it will not be modified. When a new rating is made, the API endpoint should receive the data in the same format as before.

2. On some pages there are multiple objects with their ratings, on some there is only a single entity with its rating.

3. "data-id" HTML parameter (example: "8.47-6053") is a combination of average rating and entity ID.

I attach 2 JS files with the code be converted and 1 file with the example of usage in the HTML code. Please convert code in the files jRating.start.js and jRating.jquery.js.
Related categories: JavaScript AJAX CSS jQuery / Prototype