A 17-year-old boy has been rushed to hospital after an attack near Leeds.