0

const checkQs = '<html>Hi everyone, I live in +++America+++.</html>';

let newStr = checkQs.replace(
  /\++(.*)\++/g,
  '<p contenteditable="true" onChange={handleChange} html={"$&"} >$&</p>',
);

In here I have replaced America with contentEditable, where I can update, But onChange function is not working

Anhdevit
  • 1,926
  • 2
  • 16
  • 29
mithelan
  • 190
  • 9
  • Can you give a little bit of more context? – 0xc14m1z Sep 30 '20 at 06:42
  • I donot think contentEditable will trigger `change` events – Beingnin Sep 30 '20 at 06:42
  • You might have a solution in here https://stackoverflow.com/questions/1391278/contenteditable-change-events – Beingnin Sep 30 '20 at 06:43
  • @0xc14m1z what I try to do is from a text, im getting a word using identifer +++, after getting that particular word im sending it to contenteditor where i can edit that word . I have done upto that. I'm stuck with the onchange function where it is not working – mithelan Sep 30 '20 at 06:45

0 Answers0