Input-Output Exchange
xxxxxxxxxx
string='text rows in this box could be changed'+\
' and displayed in the next cell'
html("""
<table>
<tr><td style='color:darkorchid;'><center>
linked html elements: input text
</center></td></tr>
<tr><td colspan='3'>
<textarea id='input_text_area'
style='color:darkblue;' cols='70' rows='3'>"""+\
string+"""</textarea>
</td></tr>
</table>""")
xxxxxxxxxx
html("""
<table>
<tr><td style='color:darkorchid;'><center>
linked html elements: output text
</center></td></tr>
<tr><td colspan='3'>
<textarea id='output_text_area'
style='color:darkblue;' cols='70' rows='3'></textarea>
</td></tr>
</table>
<script>
var myObj,myJSON,text,obj;
myObj={'input_text':
document.getElementById('input_text_area').value};
myJSON=JSON.stringify(myObj);
localStorage.setItem('testJSON',myJSON);
text=localStorage.getItem('testJSON');
obj=JSON.parse(text);
document.getElementById('output_text_area')
.innerHTML=obj.input_text;
<"""+"""/script>""")
No comments:
Post a Comment