How and why does Huck's attitude change throughout the novel and how does his attitude toward Jim compare to that of others?
Huck has a more personal relationship with Jim than others who meet Jim. Huck has known him for a long time, and he has sought Jim's advice on a number of occasions (such as the incident with the hairball). When they find themselves on the island together and then journeying on the raft, their relationship grows and changes as we would expect it to. With that change, comes the change of the reader's perspective. Huck has always been taught that black people are property--they are void of feelings, dreams, intellect, etc. Living with Jim as Huck does in such close proximity teaches him that his beliefs are wrong. Huck has a paradigm shift--a realization that Jim is just like he is, only with black skin. This is what Twain's goal was. He wished to open the eyes of those ignorant enough to believe what they were taught without finding out firsthand if it were true or not. Jim becomes a friend--not a slave to be bought and sold. Huck's life is changed forever, and so is the life of the reader.
Huck is a poor, ignorant, homeless boy with nothing about him that would give him status or make him "important" in his society. Nevertheless, through his experiences he develops the greatest kind of courage and personal integrity. Everything Huck has been taught and has grown up believing tells him to turn Jim in. His own humanity, though, tells him that to do so would violate something within himself. He struggles with this conflict, but follows his own lights in reaching a moral choice. He will not turn Jim over as a runaway slave. Huck truly believes that his choice will send his soul to Hell, but he accepts that consequence. He is a character in American literature who became an unlikely hero, an example of courage and personal integrity in defiance of social evils.
Huck is willing, if not content, to go his own way and to be alone when the novel begins. He does not feel behooved by loyalty to his father. In the end, however, Huck cannot walk away from Jim to leave this friend in a predicament. Huck is now attached, morally, to a social obligation.
Huck matures considerably over the course of the novel. In the beginning, he is not exactly just like everyone else. He is a vagabond who is used to answering to his own drummer. Yet he befriends Jim, finds he has a conscience, learns empathy, and goes on his own way.
Huck's attitude towards Jim changes from him thinking that Jim is just property and an ignorant slave that is below him, to feeling that Jim is his good friend, and equal to him. Huck was raised in a society that devalued the individuality and humanity of slaves; slaves were property to be owned, who couldn't think for themselves, not actual humans with feelings and thoughts. Take for example the numerous pranks that Huck pulled on Jim--they reflect Huck's attitude towards Jim. After the incident where Jim and Huck get separated in the fog, Huck actually thinks that Jim is stupid enough to believe that none of it had happened, and that Jim had imagined it all. Jim calls him on this, chastising Huck for his lack of sensitivity. Huck says,
"It was fifteen minutes before I could work myself up to go and humble myself to a nigger."
This reflects his attitude of superiority over Jim. First of all, he obviously thinks Jim has no intelligence and can be had by a little kid's stupid prank, then he has a hard time "lowering" himself to apologize. Another telling incident is when they argue over language and King Solomon. They argue for a while, but then Huck gives up, stating,
"it warn't no use wasting words--you can't learn a nigger to argue. So I quit."
Here he reflects his attitude that Jim is incapable of learning, using reason and logic, or making intelligent arguments.
Later though, Huck's attitude changes. As Jim and Huck experience a lot of trials together, Huck learns to respect and care for Jim as a human being, and as an equal. At the end, he even goes so far as to say about Jim, "I know'd he was white inside." This statement shows how Huck feels that Jim is, to an extent, his equal. His attitude towards Jim has changed from him feeling Jim to be below him and less of a human, to being his equal. I hope that those thoughts help, at least in regards to Huck's attitude towards Jim. Good luck!
Here is a video summarizing the novel: