<!doctype html>
<html> <style>
li{float:left;margin:0 100px;color:red;} </style>
<head>
</head>
<body>
<div id="show" style="widht:100%;height:50px;background:#000;color:#fff;text-align:center;line-height:50px;font-size:50px;"></div>
<div style="width:100%;height:20px;background:#000;">
<ul style="list-style:none;">
<li>空间</li>
<li>阿斯蒂芬</li>
<li>l老</li>
<li>=记录=</li>
<li>狄仁杰</li>
<li>宋慈</li>
</ul>
</div> <script>
window.onload=function(){
var Oshow = document.getElementById('show');
var Oli = document.getElementsByTagName('li');
for(var i =0;i<Oli.length;i++){
Oli[i].onmouseover=function(){
Oshow.innerHTML= this.innerHTML
}
}
} </script>
</body>
</html>
  

innerHTML的运用的更多相关文章

  1. 【JavaScript】innerHTML、innerText和outerHTML的用法区别

    用法: <div id="test">   <span style="color:red">test1</span> tes ...

  2. innerHTML和innerText的区别

    以<p id="example">welcome to <strong>JavaScript</strong> !!!</p>为例: ...

  3. textarea 中的 innerHTML 和 value

    <textarea></textarea> <input type="button" value="click" /> &l ...

  4. innerHTML on ie6-9

    https://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx The innerHTML property is read-only on ...

  5. innerHTML,outerHTML,innerText,outerText区别以及insertAdjacentHTML()方法

    在需要给文档插入大量的新的HTML标记的情况下,通过多次DOM操作先创建节点再指定它们之间的关系会非常麻烦而且效率不高,相对而言插入标记的方法会更加简单,速度也更快. 插入标记中有这四个属性inner ...

  6. innerHTML与innerText的异同

    在一道面试题中看到的. 1.功能讲解: innerHTML 设置或获取位于对象起始和结束标签内的 HTML outerHTML 设置或获取对象及其内容的 HTML 形式 innerText 设置或获取 ...

  7. c#使用正则表达式抓取a标签的链接和innerhtml

    //读取网页html string text = File.ReadAllText(Environment.CurrentDirectory + "//test.txt", Enc ...

  8. innerHTML 与 innerText 的区别

    innerHTML指的是从对象的起始位置到终止位置的全部内容,包括Html标签.innerText 指的是从起始位置到终止位置的内容,但它去除Html标签.同时,innerHTML 是所有浏览器都支持 ...

  9. html()、text()、val()、innerHTML、value()的区分

    以上的方法可用于一般的html标签(div)与input中分别进行讨论 1.html(): jQuery方法,用于一般标签中,可读写,可以获得写入html标签. 2.text(): jQuery方法, ...

  10. innerHTML、innerText、outerHTML、outerText的区别

    我们在用JS/JQ 获取或设置元素内容的时候,通常是获取或设置指定元素之间的内容 <script> //JS document.getElementById('test').innerHT ...

随机推荐

  1. @action 注解

    ================================================= 下载 注解配置 private String fileName; private String co ...

  2. Children of the Candy Corn (bfs+dfs)

    Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8120   Accepted: 3547 Description The c ...

  3. -_-#【Backbone】Router

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  4. [转载]使用uiautomator做UI测试

    这个只是单纯的mark一下.还没有认真去研究.鉴于最近也不会做手机的自动化测试,所以留作以后参考吧. 转自: http://blog.chengyunfeng.com/?p=504 在Android ...

  5. php几个不起眼儿的小技巧

    说是不起眼儿的小技巧,其实应该说是不常用的常规应用吧.很多事情就是这样,知道是一马事儿,会用是一马事儿,精习又是另外一马事儿.而成为高手更是需要扎实的基本功. str_repeat 重复输出字符串就靠 ...

  6. The method of type must override a superclass method解决方式

    工程导入myeclipse时,出现问题提示:The method of type must override asuperclass? annotation:@Override的原因 查阅了一下资料, ...

  7. 安装LVS安装LVS和配置LVS的工作比较繁杂

    安装LVS安装LVS和配置LVS的工作比较繁杂,读者在配置的过程中需要非常细心和耐心.在本节我们将对其进行详细地介绍.主要包括如下几个核心步骤:1.获取支持LVS的内核源代码如果读者需要使用LVS,需 ...

  8. [Angular 2] Passing Template Input Values to Reducers

    Angular 2 allows you to pass values from inputs simply by referencing them in the template and passi ...

  9. MaterialDialog的用法:

    MaterialDialog的用法:/** * * @author smiling * @date 2016/10 */ Github:https://github.com/drakeet/Mater ...

  10. NYOJ-745蚂蚁的难题(二)

    这道题和求字段和的要求就差一点,就是那个是一条链, 这个是个环,关于这么环,刚开始按照链那种方式推倒状态转移方程,但是没有写出来,后来看题解,才看到原来还是转化为普通的单链来做,好多题都是由不会的转化 ...