link1 link2 //jquery $(\"#div1 a\").click(function(){ var text = $(
Use this :
$("#div1 a").click(function(){ var text = $(this).text(); });