I am a 15 year old boy and I became attracted to a girl after I started talking to her online and occasionally in school. Is this a bad thing?
It is what is supposed to happen. It is how people eventually end up marrying someone. Now the first person you're attracted to may not be someone you will actually marry. Most often young people have little idea what exactly they are looking for in a lifetime companion. So you start somewhere and if it doesn't work out, you make adjustments and try again. And so it is a learning experience as well.
"Rejoice, O young man, in your youth, and let your heart cheer you in the days of your youth; walk in the ways of your heart, and in the sight of your eyes; but know that for all these God will bring you into judgment. Therefore remove sorrow from your heart, and put away evil from your flesh, for childhood and youth are vanity" (Ecclesiastes 11:9-10).