
Guys,, need help! I am experiencing "Uncaught TypeError: $ is not a function" in WordPress. I already add a noconflict function and declare $ as var but it's still not working. I have attached a screenshot :(
(function ($) {
var body = $( 'body' );
$ ('#flashMessage').hide()
$('#previewButton').click(function() {
const title = $("#blogTitleInput").val();
const content = $("#blogContentInput").val();
$("#blogTitlePreview").text(title);
$("#blogContentPreview").html(content);
$("#flashMessage")
.slideDown(1000)
.delay(3000)
.slideUp();
});
}(jQuery));
Guys,, need help! I am experiencing "Uncaught TypeError: $ is not a function" in WordPress. I already add a noconflict function and declare $ as var but it's still not working. I have attached a screenshot :(
(function ($) {
var body = $( 'body' );
$ ('#flashMessage').hide()
$('#previewButton').click(function() {
const title = $("#blogTitleInput").val();
const content = $("#blogContentInput").val();
$("#blogTitlePreview").text(title);
$("#blogContentPreview").html(content);
$("#flashMessage")
.slideDown(1000)
.delay(3000)
.slideUp();
});
}(jQuery));