値と変数を含む画像IDを検索したいと思います。Jquery ID属性にセレクタと変数が含まれています
$( "[id * = 'MYVALUE' + x] ')のようなスクリプトが必要ですが、動作しません。
for (x=0; x< imageList.length; x++)
{
var imageSRC = imageList[x];
//need this to be MYVALUE + the X val
//search for IDs that contain MYVALUE + X
$("[id*='MYVALUE']").attr('src', 'images/'+imageSRC);
};
<!-- These images are replaced with images from the array imageList-->
<img id="dkj958-MYVALUE0" src="images/imageplaceholder" />
<img id="mypage-MYVALUE1" src="images/imageplaceholder" />
<img id="onanotherpage-MYVALUE2-suffix" src="images/imageplaceholder" />
ありがとう、ありがとう! – User970008