HTML:
<div id="test"> <input value='asdasd' type="hidden"/> <a class="mobile_remove" id="1234">aa</a> </div>
JQ:
$(document).ready(function() {
//1、被调用函数
var removeMobile = function() {
//alert("1");
alert( $(this).parent().html());
}
//2、使用1的函数(使用匿名函数导致$(this)无效)
$(".mobile_remove").click(function(){removeMobile();});
//3、使用1的函数(直接赋值,$(this)有效)
$(".mobile_remove").click(removeMobile);
}