I have a string like:
<span class="someClass" id="skAdmin" data-options='{
"elmsList" : {
"#skAdmin" : {
"action" : "replace",
"replaceWith" : "<input class=\"form-control\">"
}
}
}'>Name</span>
Now (when i make a click on this span) I need to replace this element (span) by element in data-options (input). And at the same time i need to add all span attributes to input element, but input is just a text (not an object). How can I convert this to object?
JSON.parse()!JSON.parseseems redundant.