diedVIPs

html knowhow

Farbe der Zelle ändern










Farbe der Zelle ändern

So sieht´s aus





Quellcode
<!DOCTYPE html>
<html>
<head>
<style type="text/css">Hier nichts</style>
</head>

<body>
<input id='btnBlue' type='button' value='Blau' />
<input id='btnGreen' type='button' value='Grün' />
<input id='btnYellow' type='button' value='Gelb' />
<script>
var color = "White"
$( "#btnBlue" ).click(function() {
color = "Blue"
});
$( "#btnGreen" ).click(function() {
color = "Green"
});
$( "#btnYellow" ).click(function() {
color = "Yellow"
});
$("table tr td").click(function(){
$(this).css("background-color", color);
});
</script>
</body>

</html>








Kontakt    Datenschutz    Impressum