清流

<div style="clear:both"></div>

获取图片路径

var _heads = document.getElementsByClassName("heads_item");
    for (var i = 0; i < _heads.length; i++) {
        _heads[i].onclick = function () {
            for (var j = 0; j < _heads.length; j++) {
                _heads[j].style.backgroundColor = "";
            }
            this.style.backgroundColor = 'red';
            document.getElementById('TextBox3').value = this.getElementsByTagName('img')[0].getAttribute('src');
        }
    }

posted on 2017-12-17 22:51  我勒个去YCQ  阅读(114)  评论(0编辑  收藏  举报