i am trying to use some javascript-code within an HTML-Page, but in doesn't work (Everything inside of a Ruby on Rails project). So i have the following HTML-Code
<a href="#" compilation_id = 51 onclick="start_render(this)">Render</a>
What I need is to get the parameter "compilation_id" inside the js-function
<script type="text/javascript" language="javascript">
function start_render(event){
var comp_id = $(event.target).attr('compilation_id');
alert(comp_id);
.....
I use alert(comp_id) just for debugging in order to see, if I get the data appropriately. But what I get is "undefined". When I set the value of the variable inside of the js-function, everything is Ok. So,
var comp_id = 51;
alert(comp_id);
works well, I get "51".
What is my mistake?
Thanks in advance.