Five start rating javascript plugin

Javascript five start plugin with material icons


1

Examples

Rating




Source code
<html>
<script src="https://bossanova.uk/jsuites/v2/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v2/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>


2

Methods

getValue();Get the current value
setValue(newValue);Set a new value
@param int newValue - Set a new value


3

Events

onchangeTrigger a method when value is changed.


3

Initialization options

var defaults = {
    value:null,
    onchange:null,
};