古詩詞大全網 - 個性簽名 - JQuery怎樣找到所有指定ID的標簽

JQuery怎樣找到所有指定ID的標簽

<!DOCTYPE?HTML>

<html>

<head>

<meta?charset=UTF-8>

<title>recursion</title>

<style?type="text/css">

</style>

<script?type="text/javascript"?src="jquery-1.8.0.min.js"></script>

<script?type="text/javascript">

$?(function?()

{

$?("[id]").each?(function?()

{

alert?(this.id);

})

})

</script>

</head>

<body>

<div?id="div"></div>

<span><img?id="img"?/></span>

</body>

</html>