Israeli lawmakers have approved jailing children as young as 12 convicted of "terrorist offences" following repeated attacks by young Palestinians, parliament said on Wednesday.