URL(herf)をスタイルから変更しようとしています。iframeからjavascriptでタグ名で要素を変更する方法
<iframe src="https://www.website.com/............" heght="100%" width="100%" >
#document
<!DOCTYPE html>
<html>
<head></head>
<body>
<a class="class" href="https://www.website.com/-----" style="background: url("https://www.website.com/abc.png") center center/100% no-repeat; width: 110px; height: 26px;"></a>
</body>
</html>
<iframe>
にそれを確認してください、私は別のURLでJavaScriptの
: style="background: url("https://www.website.com/abc.png")
で画像のURLを変更したいです。変更することが重要でxyz.pngその
: style="background: url("https://www.website.com/xyz.png")
画像のように
。
それを試してみてください?試したコードはどこにありますか?可能性のある[querySelectorAll、getElementsByClassNameと他のものを返す]の可能な複製があります(https://stackoverflow.com/questions/10693845/what-do-queryselectorall-getelementsbyclassname-and-other-getelementsby-method) – Teemu