2010-08-10 15 views
0

我有數字(在html文本中):1,2,3,4,5. 當我推動數字時,我需要在jQuery中獲取這些數字。這看起來像什麼?也許有人有樣品?從html到jQuery獲取數字

在PHP中,這是很容易:

echo $_GET['num']; 
<a href = "index.php?num=1">1</a> 
<a href = "index.php?num=2">2</a> 

但如何,這使得與jQuery?

回答

0
$('a').click(function() { 
    alert($(this).html()); 
});