Can an Iphone 5 get hacked/get a virus?

So I was on twitter on my iphone 5 and i accidentally clicked on a link from those fact accounts. I closed the window before it could fully loads if that helps. I was wondering if I could get hacked/get a virus/malware on my iphone.

please help. I haven't jailbroken it btw. But it isn't updated all the way

It could but it is still very rare

You don't need to worry about that on an iphone. If jailbroken and downloading stuff from anywhere then you can get a virus. If its not jailbroken then all apps install through the appstore which is extremely safe, its one of the best things since all code is reviewed before it can get in the appstore, so you don't even need to run antivirus like other phones do.