javascript domを使ってdivタグのボーダー画像を変更したい
あなたは次のようにすることができます:
var dv = document.getElementById('#divID');
dv.style.borderImage = 'url(border.png) 30 30 round';
dv.style.MozBorderImage = 'url(border.png) 30 30 round';
dv.style.WebkitBorderImage = 'url(border.png) 30 30 round';
dv.style.OBorderImage = 'url(border.png) 30 30 round';
すべての DIV に対して実行する場合:
var dvs = document.getElementsByTagName('div');
for (var i = 0; i < dvs.length; i++) {
dvs[i].style.borderImage = 'url(border.png) 30 30 round';
dvs[i].style.MozBorderImage = 'url(border.png) 30 30 round';
dvs[i].style.WebkitBorderImage = 'url(border.png) 30 30 round';
dvs[i].style.OBorderImage = 'url(border.png) 30 30 round';
}