js 点击按钮改变 img路径 求解~~~急急急~~~坐等!!! js 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 点击之后吧,11里面的内容换成22里的 $(function(){ $(".div1").click(function(){ var str22=$(".22").html(); alert(str22); $(".11").html(str22); }) }) 不行的话,写2个IMG吧,隐藏一个 显示一个 LZ的src写成scr了另外, 类名最好不要以纯数字命名. <!DOCTYPE html><html><head> <meta charset="utf-8"> <title>document</title> <script type="text/javascript" src="script/jquery.js"></script> <script type="text/javascript"> function a(){ var html = $(".11").html(); $(".22").html(html); } </script> <style type="text/css"> </style></head><body> <button onclick="a()">change</button> <div class="11"> <a href="#"> <img src="1.jpg" /> </a> <a> <img src="2.jpg" /> </a> </div> <div class="22"> <a> <img src="3.jpg" /> </a> <a> <img src="4.jpg" /> </a> </div> <div class="div1"></div> <div class="div2"></div></body></html> $(function(){ $(".div1").click(function(){ $(".11").attr("src",$(".22").attr("src")); })})图片的scr 改成src 星星打分 js代码问题 关于Modal的一个问题``请进 求一正规表达式 能不能实现一个可以让用户直接输入内容的下拉列表? 表格 问题 firefox中关于event对象的传递? 如何把子Table中的内容換成自己想要的実際内容? javascript为何取不到好多网页中的东西,vbscript的for...next怎么用? easyui datagrid 双击编辑时给 combobox列绑定数据 jquery 如何获得span中的文本值 下面这段javascript代码是什么意思呢?好深奥难懂哦
$(".div1").click(function(){
var str22=$(".22").html();
alert(str22);
$(".11").html(str22);
})
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>document</title>
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript">
function a(){
var html = $(".11").html();
$(".22").html(html);
}
</script>
<style type="text/css">
</style>
</head>
<body>
<button onclick="a()">change</button>
<div class="11">
<a href="#">
<img src="1.jpg" />
</a>
<a>
<img src="2.jpg" />
</a>
</div> <div class="22">
<a>
<img src="3.jpg" />
</a>
<a>
<img src="4.jpg" />
</a>
</div> <div class="div1"></div>
<div class="div2"></div>
</body>
</html>
$(function(){
$(".div1").click(function(){
$(".11").attr("src",$(".22").attr("src"));
})
})
图片的scr 改成src