Just created a simple script trying to make a conditional statement but I don't know why and what is wring that I am getting his error in my console
Uncaught ReferenceError: Invalid left-hand side in assignment
Here is my code please let me know what is wrong with this
$(document).ready(function() {
$("#postcomment").click(function() {
var name = $('#name').val();
var email = $('#email').val();
var comment = $('#comment').val();
var post = $('#pt').val();
if(email == null && name == null && comment = null) {
alert('Fields cannot be empty');
} else {
$.ajax({
type : "POST",
url : "include/get_data.php",
dataType : "text",
data : {name : name, email : email, comment : comment, post : post, command : 'comment'},
success : function(data) {
$("#all").apppend(data.commenting);
$("#counts").html(data.count);
document.getElementById('name').value = '';
document.getElementById('email').value = '';
document.getElementById('comment').value = '';
}
});
}
});
});