Underwater electrocardiography (ECG) monitoring, which can monitor cardiac autonomic changes and arrhythmias during diving, is essential for sports management and healthcare. However, it is crucial yet rather challenging to achieve ECG monitoring in an aquatic environment because the interface electrodes may lose their functionality underwater. Here, an ionogel with tailorable mechanical properties is prepared by a facile one-step polymerization and used as water-resistant electrode. The Young's modulus and strain at break of the ionogel can be modulated in the range of 0.22-337 MPa and 349 to >10 000%, respectively. The hydrophobic polymer networks inside the ionogel endow this ionogel with excellent stability, adhesion, and selfhealing ability underwater. The ionic conductivity imparted by the free ionic groups inside the ionogel allows the ionogel to detect and transmit physiological electrical signals. Compared with commercial gel electrodes, this ionogel electrode demonstrates better adhesion ability, conductivity, and stability underwater. The ionogel electrode can collect real-time ECG signals effectively both in the air and underwater, and the data can be used to warn users of the potential risk of a heart attack.