Type /keyboard to make sure of your commands on your computer. On mine, z is for diving under the water and spacebar brings me back up. Once you are under the water, you will be able to attack your enemies. It's a little different under the water, but you will get used to it. Movement is a little slower at times.
Also, make sure you remember to buy aquatic breathing potion and /use it before you go under, or you won't live very long. lol