---
title: "Javascript events"
description: "Dealing with the javascript rating plugin events."
source: https://jsuites.net/docs/v4/rating/events
---

### Basic javascript vanilla example with events

```html
<html>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

<div id='rating'></div> <div id='console'></div>

<script>
jSuites.rating(document.getElementById('rating'), {
    value: 3,
    onchange: function(el, val) {
        document.getElementById('console').innerHTML = val + ' star selected';
    },
    tooltip: [ 'Very bad', 'Bad', 'Average', 'Good', 'Very good' ],
});
</script>
</html>
```
