Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]olx, zmiana koloru tekstu
thumas
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 1.06.2015

Ostrzeżenie: (0%)
-----


chce zmienić kolor wyświetlanego tekstu z czarnego na niebieski, czy jest to wogóle możliwe?
Jeśli ktoś potrafi i zna odpowiedz proszę o rozwiązanie poniżej.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
thumas
post
Post #2





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 1.06.2015

Ostrzeżenie: (0%)
-----


pakowałem <!DOCTYPE html>
<html>
<head>
<style>
#myDIV {
position: absolute;
width: 100px;
height: 100px;
background-color: coral;
}
</style>
</head>
<body>

<p>Click the "Try it" button to set the text-color of the DIV element to "lightblue":</p>

<button onclick="myFunction()">Try it</button>

<div id="myDIV">
<h1>myDIV</h1>
</div>

<script>
function myFunction() {
document.getElementById("myDIV").style.color = "lightblue";
}
</script>

</body>
</html>
wkleiłem np. ten kod i tekst wymieniłem
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 28.12.2025 - 05:55