Orthogonal frequency division multiplexing (OFDM) with index modulation (IM), OFDM-IM, is considered as a potential enabling technology for 5G and beyond wireless networks due to its advantages compared to OFDM. This paper firstly examines and compares the error performance of uncoded OFDM-IM and OFDM under barrage jamming (BJ) and partial band jamming (PBJ) attacks. In addition, we propose a novel arbitrary jamming (AJ) model and extend our analysis to this attack. We demonstrate that uncoded OFDM-IM is more resistant against jamming attacks when compared to uncoded OFDM. In the OFDM-IM system, we derive an upper bound for the average bit error probability under AJ attack to verify our simulation results. The achievable rate of OFDM-IM under jamming attack is also investigated. We then apply low-density parity-check (LDPC) coding to further enhance the strength of the system under a heavy jamming attack. The optimum log-likelihood ratios for the OFDM-IM system in the case of jamming attack are calculated. We compare and analyze the bit error rate (BER) performances of LDPC coded OFDM and OFDM-IM for different jamming types, code rates, code block lengths, and code decoding algorithms through extensive computer simulations. At high code rates under jamming attack, we prove that the coded OFDM-IM has BER performance superiority. Moreover, we demonstrate that coded OFDM-IM is more resistant against imperfect channel state information than coded OFDM under BJ. We also compare the performances of LDPC coded OFDM-IM and the higher-order OFDM-IM (HO-OFDM-IM), an enhanced version of OFDM-IM.