対象ノードがノードの場合にエレメントの属性リストを返し、ノードでない場合はNULLを返します。 特定のimg要素の属性取得 サンプルを見る<p><img src="./img/pic1-thumb.png" alt="Krispy Kreme Doughnuts" id="sweets" /></p> <form action="#"> <input type="button" value="属性取得" onclick="fGetAttributes()" /> <p id="resGetAttributes"></p> </form> <script type="text/javascript"> function fGetAttributes(){ var s=""; if(document.getElementById("sweets").attributes.l