CSS

js获取属性

document.getElementById(id).currentStyle.属性;

js修改属性

document.getElementById(id).style.属性 = 值;

DOM(例href属性)

JS获取href

var imgUrl = document.getElementById(id).href;

JQ获取href

$(document).ready(function(){
 $(
"a").hover(function(){
  
var imgUrl = $(this).attr("href");    alert(imgUrl);
 });   
});

 

 

 

相关文章:

  • 2019-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
猜你喜欢
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案