My callback function is not working. What am I doing wrong?
<script>
$("button").click(fnction(){
$("p").hide("slow", function(){
alert("The paragraph is now hidden");
});
});
</script>
My callback function is not working. What am I doing wrong?
<script>
$("button").click(fnction(){
$("p").hide("slow", function(){
alert("The paragraph is now hidden");
});
});
</script>
the word function is misspelled
$("button").click(fnction(){
Fix it.
$("button").click(function(){
You have a typo. Use arrow functions for callbacks.
<script>
$("button").click(() => {
$("p").hide("slow", () => {
alert("The paragraph is now hidden");
});
});
</script>