日期:2014-05-16 浏览次数:20479 次
<ul id="a"> <li><span id="s">这里需要编辑</span><input type="text" id="t" style="display:none" onblur="ee()"/></li> <li><a href="javascript:void(0);" class="b" onclick="se()">编辑</a></li> </ul> <script type="text/javascript"> var ss = document.getElementById("s"); var tt = document.getElementById("t"); se = function(){ tt.value = ss.innerHTML; ss.style.display = "none"; tt.style.display = "block"; } ee = function(){ ss.innerHTML = tt.value; tt.style.display = "none"; ss.style.display = "block"; } </script>