Back

Add Text in textarea at the point of cursor

Copy Below Code View As A Text File Show Text Only Show API Edit Code
                            

//CALL Function ---- typeInTextarea($('[name=additional_field_1]'), '{Name}'); function typeInTextarea(el, newText) { var start = el.prop("selectionStart") var end = el.prop("selectionEnd") var text = el.val() var before = text.substring(0, start) var after = text.substring(end, text.length) el.val(before + newText + after) el[0].selectionStart = el[0].selectionEnd = start + newText.length el.focus() }