alerzo,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
function set_rating(num)
{
alert(num)
}
$(function(){
$('button.btn.btn-primary:contains("Отправить")').trigger('click');
});
</script>
</head>
<body>
<button type="button" class="btn btn-primary" onclick="set_rating(112);">Отправить</button>
<button type="button" class="btn btn-primary" onclick="set_rating('test');">test</button>
</body>
</html>