Wan Nian Yichang-vomiting blood to sort out JavaScript-DOM manipulation

I haven't changed it for more than a month. After returning to school, I was busy hahahaha. Today, I suddenly thought of my blog. This blog is mainly about handwritten notes (because I feel that typing is too slow and waste time)
Ah, don’t think I’m ugly! ! !
Insert picture description here
Because I wanted to learn about web development in my sophomore year, I set up a small flag for myself. Before my junior year, I basically made a website of my own. Recently I have been reviewing the videos of station B. Today DOM operation is the end of learning. But it hasn't been combated yet. This is a bit non-ZBC. Not much nonsense, first, let’s take a
Insert picture description here
handwritten note below the basic key knowledge of JavaScript, which focuses on JavaScript DOM operations. Those who have learned C++ or C or other languages ​​can basically understand logical theory. Learn one, and you will know everything. . Insert picture description here
Insert picture description here
Exclusive algorithm

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Le</title>
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div id="box">
        <ul id="nav">
            <li>Le简介</li>
            <li>开发领域</li>
            <li>合作伙伴</li>
            <li>Le成员</li>
            <li>Le发展前景</li>
            <li>联系方式</li>
        </ul>
    </div>
    <script>
        //鼠标经过改变背景色
        var ul=document.getElementById('nav');
        for(var i=0;i<ul.children.length;i++) {
    
    
            ul.children[i].onmouseover=function() {
    
    
                for(var j=0;j<ul.children.length;j++) {
    
    
                    ul.children[j].style.background='#00000000';
                }
                this.style.background='#00f2fe';
            }
        }
    </script>
</body>
</html>

Show results:
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
6
A few days ago, I used Ali’s server for seven days, Gan, it was about to expire.
Now I am doing some simple pages, and try my best to use JavaScript to achieve simple website interaction

Click to enter- Pipihan's Secret House .

It's not open to the public at the moment, oh oh, you guys have to look at the login page hahaha fuck
page display (actually it's dynamic): I
Insert picture description here
slipped away, and I will update the BOM in two weeks!Insert picture description here

Guess you like

Origin blog.csdn.net/pipihan21/article/details/108655073