N
N
Nicholas2015-09-01 16:16:04
JavaScript
Nicholas, 2015-09-01 16:16:04

How to output json string to value in input?

I'm trying to insert json string from array into input

innerHTML='	<b class="b">Usage:</b><br><br><input id="Method-Usage-1" type="text" value="'+(local[4].Method_Usage)+'" class="input-Usage"><br><br>';

But on the way out I get
<input id="Method-Usage-1" value="{" method":="" "login",="" "data":="" "{="" \"login\":="" \"login\",="" \"pass\":="" \"pass\"}"}"="" class="input-Usage" type="text">

How to get normal code with json in value?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2015-09-01
@Menlod

api.jquery.com/jquery.parsejson

N
Nicholas, 2015-09-01
@ACCNCC

I had to replace input with textarea

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question