Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Javascript を使用して、画像の絶対パスを取得する標準的な方法はありますか? HTML で宣言されimg.getAttribute("src")た属性のみを返します。src
img.getAttribute("src")
src
するだけです.src。
.src
$('img')[0].src = '/images/foo.gif' "/images/foo.gif" $('img')[0].src "http://stackoverflow.com/images/foo.gif" $('img')[0].getAttribute('src') "/images/foo.gif"