Entschuldigung, wenn das schon einmal gefragt wurde, aber ich konnte nichts finden. Ich lerne Javascript im Free Code Camp zu programmieren. Wenn ich versuche, ihren Code für mich selbst zu verwenden ...Javascript funktioniert nicht in HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
$(document).ready(function() {
$("#getMessage").on("click", function(){
// Only change code below this line.
$(".message").html("Here is the message");
// Only change code above this line.
});
});
</script>
<div class="container-fluid">
<div class = "row text-center">
<h2>Cat Photo Finder</h2>
</div>
<div class = "row text-center">
<div class = "col-xs-12 well message">
The message will go here
</div>
</div>
<div class = "row text-center">
<div class = "col-xs-12">
<button id = "getMessage" class = "btn btn-primary">
Get Message
</button>
</div>
</div>
</div>
</body>
</html>
Es funktioniert nicht wie es sollte. Es sollte den Text ändern, wenn die Taste gedrückt wird, aber nicht. Was ist los?
Sie verwenden jquery aber du bist es nicht, die Quelle zu importieren – Jorius