标签:utf-8 html ons text 输入 obj function OLE script
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<input type="text" id="input">
<input type="text" id="b">
<button onclick="trans()">转换</button>
<script>
function trans(){
var a = document.querySelector(‘#input‘)
var b = document.querySelector(‘#b‘)
const obj = {
value :a.value,
value2:b.value
}
console.log(JSON.stringify(obj).replace(/\\\\/ig,"\u005c"),"stringify")
}
</script>
</body>
</html>
标签:utf-8 html ons text 输入 obj function OLE script
原文地址:https://www.cnblogs.com/chengyunshen/p/13436833.html