首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

javascript 操作 div <h3>标记解决方法

2012-02-14 
javascript 操作 divh3标记javascript如何改变 h3标记里的文字例如divclass testdiv h3id tes

javascript 操作 div <h3>标记
javascript   如何改变 <h3>   标记里的文字
例如
<div   class= "testdiv ">
      <h3   id= "testh3 ">
            如何改变我
      </h3>
</div>


[解决办法]
<script type= "text/javascript " src= "http://code.jquery.com/jquery-latest.pack.js "> </script>
<script type= "text/javascript " language= "JavaScript ">
$(document).ready(function(){
$( ".testdiv/h3 ").html( '就是改变你 ');
});
</script>
<div class= "testdiv ">
<h3 id= "testh3 ">
如何改变我
</h3>
</div>
[解决办法]
<div class= "testdiv ">
<h3 id= "testh3 ">
如何改变我
</h3>
</div>

<SCRIPT LANGUAGE= "JavaScript ">
<!--
var testh3 = document.getElementById( "testh3 ");
testh3.innerHTML = "这样改变你 ";
//-->
</SCRIPT>
[解决办法]
ding!

热点排行