Compare commits
2 Commits
b89ee1e8b5
...
c2c4d68837
Author | SHA1 | Date |
---|---|---|
james | c2c4d68837 | |
james | d87b07ad38 |
12
fetch.js
12
fetch.js
|
@ -5,8 +5,18 @@ let lista
|
|||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
wyswietlSufiksy(data)
|
||||
});
|
||||
|
||||
function wyswietlSufiksy(data) {
|
||||
data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `<li> ${JSON.stringify(element.osoby)} </li>`);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("nieposortowane").onmouseover = function() {mouseOver()};
|
||||
document.getElementById("nieposortowane").onmouseout = function() {mouseOut()};
|
||||
function mouseOver() {
|
||||
document.getElementById("nieposortowane").style.color = "red";
|
||||
}
|
||||
function mouseOut() {
|
||||
document.getElementById("nieposortowane").style.color = "black";
|
||||
}
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Sortowanie Sufiksów</h1>
|
||||
<button onclick="sortujSufiksy()">Sortuj Sufiksy</button>
|
||||
<button onclick="wyswietlSufiksy()">Wyswietl Sufiksy</button>
|
||||
<h2>Nieposortowane Sufiksy</h2>
|
||||
<div class="pre" id="nieposortowane"></div>
|
||||
<h2>Posortowane Sufiksy</h2>
|
||||
|
|
|
@ -50,6 +50,15 @@ h2 {
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* li:hover {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#nieposortowane:hover {
|
||||
background-color: white;
|
||||
} */
|
||||
|
||||
|
||||
/* .pre {
|
||||
background-color: #fff;
|
||||
|
|
Loading…
Reference in New Issue