My page is an editable table table t. I use contenteditable to get the input box. How do I get the value?

my page is an editable table table t. I use contenteditable to get the input box. How do I get the value?

the innerText I used to get is

  "\t\t\t\t\t\t\t\t\n-sharp1\t762\t63.5%\t48235\t3158\t9.67%\t64\t313869\t523\n-sharp1\t762\t63.5%\t3158\t64\t313869\t523\n-sharp1\t762\t63.5%\t48235\t3158\t9.67%\t64\t313869\t523\n-sharp1\t762\t63.5%\t3158\t64\t313869\t523\n-sharp1\t762\t63.5%\t48235\t3158\t9.67%\t64\t313869\t523\n-sharp1\t762\t63.5%\t3158\t64\t313869\t523\n\t\t\t\t\t\t\t\t\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t\t\t\t\t\t\t\t\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n\t165\t\t39408\t3810\t3.2%\t32\t56117\t468\n"
  
  

this is not in json format. I don"t know exactly what the user is editing, how to convert it to json format or how to get the value.

Mar.03,2021

for example, if you set contenteditable, for div, you bind a blur event to the div. Through this event, you can str.split ("") into an array


you should use innerHtml to get dom, and then traverse dom, to convert the data you need

.
Menu