jquery,javascript -设置某一ul下的li下的 a的属性

//javascript
var ul = document.getElementById('ul); var as = ul.getElementsByTagName('a'); for(var i = 0; i <as.length; i++) { as.item(i).onmouseover = function() { var iframe_con = document.getElementById(pos_content); var src = './content/' + this.innerHTML + '.html'; iframe_con.setAttribute('src', src); console.log(src); } } //jquery $("#um_div li a").mouseover(function () { $("#" + pos_content + "_content").attr('src', 'content/' + this.innerHTML + ".html"); });

 

你可能感兴趣的:(JavaScript)