Generalize to arbitrary contenteditable or input fields