
$\overrightarrow{\mathrm{F}}=\mathrm{i} l \hat{\mathrm{k}} \times(-\mathrm{B} \hat{\mathrm{i}})$
$\overrightarrow{\mathrm{F}}=-\mathrm{i} l \mathrm{B} \hat{\mathrm{j}}=\mathrm{i} l \mathrm{B}(-\hat{\mathrm{j}})$
Hence, the direction of magnetic force on the wire is towards $Q.$

