Basic jquery question. I have an option element as below.
<option class='select_continent' value='7'>Antarctica</option>
jquery
$(".select_continent").click(function () {
alert(this.attr('value'));
});
This gives an error saying this.attr is not a function so im not using "this" correctly.
How can i get it to alert 7?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…