$('.class1') will yield a reference to a jQuery object wrapping zero or more elements. It will not be a reference to a DOMNode. You do not at that point have access to any property named value. There is a function called val that will yield the value of the first element matched by the selector, if any.
if($('.class1').val() != '1') {
$('.class2').hide();
}
Furthermore, you're trying to use = to check for equality, but = is only used for assignment. You should use == in conditions. Now that you're looking for the inverse of equality, you shouldn't use !X==Y but X!=Y.