0
ich schlinge meinen Code in einer ready
Funktion Hilfe benötigen Unten ist mein Code:
var color = "White";
$("#btnBlue").hover(function() { color = "Blue" });
$("#btnGreen").click(function() { color = "Green" });
$("#btnYellow").click(function() { color = "Yellow" });
$("table tr td").click(function() { $(this).css("background-color", color); });
ich wickeln will der Code in die Funktion unten.
$(document).ready(function() {
// Your code here.
});
ich schätze jede Hilfe geben kann
Was ist exaclty die Frage? Warum platzieren Sie Ihren Code nicht einfach in der Dokumentbereitschaftsfunktion? – Christos
Was hielt Sie davon ab, es in '$ (document) .ready (function() {' – Rayon
zu verpacken, kopieren Sie einfach Ihren Code auf "// Ihr Code hier." :) – Mehmet