I have this code:
html:
<div class="ui blue button" id="f{{i}}" onclick="Dailer()">Get this!</div>
which returns:
<div class="ui blue button" id="f1" onclick="Dailer()">Get this</div>
And when I use JS:
function Dailer() {
alert($(this).attr('id'));
}
I get undefined
, even when using alert(this.id)
doesent work.
But if I run the code on console, it works:
$("#f1").attr("id")
"f1"